/[escript]/trunk/tools/libescriptreader/src/escriptreader/ElementData.h
ViewVC logotype

Diff of /trunk/tools/libescriptreader/src/escriptreader/ElementData.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2205 by caltinay, Wed Jan 7 06:14:59 2009 UTC revision 2206 by caltinay, Fri Jan 9 03:50:29 2009 UTC
# Line 34  typedef enum { Line 34  typedef enum {
34      ZONETYPE_TRIANGLE      ZONETYPE_TRIANGLE
35  } ZoneType;  } ZoneType;
36    
37  //  /// \brief Holds information that is used to convert from escript element types
38  // Holds information that is used to convert from escript element types to  /// to Silo.
 // Silo.  
 //  
39  struct FinleyElementInfo  struct FinleyElementInfo
40  {  {
41      ZoneType elementType, reducedElementType;      ZoneType elementType, reducedElementType;
# Line 46  struct FinleyElementInfo Line 44  struct FinleyElementInfo
44      const size_t* multiCellIndices;      const size_t* multiCellIndices;
45  };  };
46    
47  //  /// \brief A class that stores and manipulates one type of escript mesh elements
48  // A class that stores and manipulates one type of escript mesh elements  /// (elements, faces, contacts or points).
49  // (elements, faces, contacts or points). The corresponding mesh nodes are  ///
50  // not part of this class but stored in a Mesh object which has to be provided  /// The corresponding mesh nodes are not part of this class but stored in a Mesh
51  // when constructing an ElementData object.  /// object which has to be provided when constructing an ElementData object.
 //  
52  class ElementData  class ElementData
53  {  {
54      friend class DataVar;      friend class DataVar;
55      friend class MeshWithElements;      friend class MeshWithElements;
56  public:  public:
57    
58      /// Constructor with name and accompanying Mesh object.      /// \brief Constructor with name and accompanying Mesh object.
59      ElementData(const std::string& elementName, const Mesh* mainMesh);      ElementData(const std::string& elementName, const Mesh* mainMesh);
60    
61      /// Copy constructor      /// \brief Copy constructor
62      ElementData(const ElementData& e);      ElementData(const ElementData& e);
63    
64      /// Virtual destructor      /// \brief Destructor
65      virtual ~ElementData();      ~ElementData();
66    
67        /// \brief Reads element data from escript NetCDF file.
68      bool readFromNc(NcFile* ncfile);      bool readFromNc(NcFile* ncfile);
69    
70        /// \brief Moves "ghost" elements and corresponding data to the end of the
71        /// arrays.
72      void handleGhostZones(int ownIndex);      void handleGhostZones(int ownIndex);
73    
74        /// \brief Removes "ghost" elements.
75      void removeGhostZones();      void removeGhostZones();
76    
77        /// \brief Writes element data into given directory in given Silo file.
78        ///
79        /// Since the mesh depends on element information this method also writes
80        /// the mesh itself. If Silo was not available at compile time or if a Silo
81        /// function fails this method returns false.
82      bool writeToSilo(DBfile* dbfile, const std::string& siloPath);      bool writeToSilo(DBfile* dbfile, const std::string& siloPath);
83    
84        /// \brief Returns the names of the meshes associated with the elements.
85      StringVec getMeshNames() const;      StringVec getMeshNames() const;
86    
87        /// \brief Returns a vector with the mesh variable names.
88      StringVec getVarNames() const;      StringVec getVarNames() const;
89    
90        /// \brief Returns the number of elements.
91      int getCount() const { return count; }      int getCount() const { return count; }
92    
93        /// \brief Returns the number of reduced elements.
94      int getReducedCount() const { return reducedCount; }      int getReducedCount() const { return reducedCount; }
95    
96        /// \brief Returns the number of nodes per element.
97      int getNodesPerElement() const { return nodesPerElement; }      int getNodesPerElement() const { return nodesPerElement; }
98    
99        /// \brief Returns the number of nodes per reduced element.
100      int getReducedNodesPerElement() const { return reducedNodesPerElement; }      int getReducedNodesPerElement() const { return reducedNodesPerElement; }
101    
102        /// \brief Returns the number of "ghost" elements.
103      int getGhostCount() const { return numGhostElements; }      int getGhostCount() const { return numGhostElements; }
104    
105        /// \brief Returns the number of "ghost" reduced elements.
106      int getReducedGhostCount() const { return numReducedGhostElements; }      int getReducedGhostCount() const { return numReducedGhostElements; }
107    
108        /// \brief Returns the type of the elements.
109      ZoneType getType() const { return type; }      ZoneType getType() const { return type; }
110    
111        /// \brief Returns the type of reduced elements.
112      ZoneType getReducedType() const { return reducedType; }      ZoneType getReducedType() const { return reducedType; }
113    
114        /// \brief Returns a vector of the node IDs used by the elements.
115      const IntVec& getNodeList() const { return nodes; }      const IntVec& getNodeList() const { return nodes; }
116    
117        /// \brief Returns a vector of the node IDs used by the reduced elements.
118      const IntVec& getReducedNodeList() const { return reducedNodes; }      const IntVec& getReducedNodeList() const { return reducedNodes; }
119    
120        /// \brief Returns a vector of element IDs.
121      const IntVec& getIDs() const { return ID; }      const IntVec& getIDs() const { return ID; }
122    
123  private:  private:

Legend:
Removed from v.2205  
changed lines
  Added in v.2206

  ViewVC Help
Powered by ViewVC 1.1.26