/[escript]/trunk/weipa/src/ElementData.h
ViewVC logotype

Diff of /trunk/weipa/src/ElementData.h

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

trunk/dataexporter/src/ElementData.h revision 3035 by caltinay, Sun Jan 31 22:17:22 2010 UTC trunk/weipa/src/ElementData.h revision 3037 by caltinay, Mon Jun 14 00:59:30 2010 UTC
# Line 14  Line 14 
14  #ifndef __ELEMENTDATA_H__  #ifndef __ELEMENTDATA_H__
15  #define __ELEMENTDATA_H__  #define __ELEMENTDATA_H__
16    
17  #include <escriptexport/escriptexport.h>  #include <weipa/weipa.h>
18    
19  extern "C" {  extern "C" {
20  #include <finley/ReferenceElements.h> // for ElementTypeId  #include <finley/ReferenceElements.h> // for ElementTypeId
# Line 28  class NcFile; Line 28  class NcFile;
28    
29  struct Finley_ElementFile;  struct Finley_ElementFile;
30    
31  namespace escriptexport {  namespace weipa {
32            
33  class NodeData;  class NodeData;
34    
# Line 76  class ElementData Line 76  class ElementData
76  public:  public:
77    
78      /// \brief Constructor with name and accompanying NodeData object.      /// \brief Constructor with name and accompanying NodeData object.
79      ESCRIPTEXPORT_DLL_API      WEIPA_DLL_API
80      ElementData(const std::string& elementName, NodeData_ptr nodes);      ElementData(const std::string& elementName, NodeData_ptr nodes);
81    
82      /// \brief Copy constructor      /// \brief Copy constructor
83      ESCRIPTEXPORT_DLL_API      WEIPA_DLL_API
84      ElementData(const ElementData& e);      ElementData(const ElementData& e);
85    
86      /// \brief Initialises with data from a Finley_ElementFile instance.      /// \brief Initialises with data from a Finley_ElementFile instance.
87      ESCRIPTEXPORT_DLL_API      WEIPA_DLL_API
88      bool initFromFinley(const Finley_ElementFile* finleyFile);      bool initFromFinley(const Finley_ElementFile* finleyFile);
89    
90      /// \brief Destructor      /// \brief Destructor
91      ESCRIPTEXPORT_DLL_API      WEIPA_DLL_API
92      ~ElementData() {}      ~ElementData() {}
93    
94      /// \brief Reads element data from escript/finley NetCDF file.      /// \brief Reads element data from escript/finley NetCDF file.
95      ESCRIPTEXPORT_DLL_API      WEIPA_DLL_API
96      bool readFromNc(NcFile* ncfile);      bool readFromNc(NcFile* ncfile);
97    
98      /// \brief Moves "ghost" elements (whose owner does not match ownIndex)      /// \brief Moves "ghost" elements (whose owner does not match ownIndex)
99      ///        and the corresponding data to the end of the arrays.      ///        and the corresponding data to the end of the arrays.
100      ESCRIPTEXPORT_DLL_API      WEIPA_DLL_API
101      void reorderGhostZones(int ownIndex);      void reorderGhostZones(int ownIndex);
102    
103      /// \brief Removes "ghost" elements.      /// \brief Removes "ghost" elements.
104      ESCRIPTEXPORT_DLL_API      WEIPA_DLL_API
105      void removeGhostZones(int ownIndex);      void removeGhostZones(int ownIndex);
106    
107      /// \brief Writes connectivity data to a stream in VTK text format.      /// \brief Writes connectivity data to a stream in VTK text format.
108      ESCRIPTEXPORT_DLL_API      WEIPA_DLL_API
109      void writeConnectivityVTK(std::ostream& os);      void writeConnectivityVTK(std::ostream& os);
110    
111      /// \brief Writes element data into given directory in given Silo file.      /// \brief Writes element data into given directory in given Silo file.
# Line 113  public: Line 113  public:
113      /// Since the mesh depends on element information this method also writes      /// Since the mesh depends on element information this method also writes
114      /// the node mesh itself. If Silo was not available at compile time or if      /// the node mesh itself. If Silo was not available at compile time or if
115      /// a Silo function fails this method returns false.      /// a Silo function fails this method returns false.
116      ESCRIPTEXPORT_DLL_API      WEIPA_DLL_API
117      bool writeToSilo(DBfile* dbfile, const std::string& siloPath);      bool writeToSilo(DBfile* dbfile, const std::string& siloPath);
118    
119      /// \brief Returns the names of the meshes associated with the elements.      /// \brief Returns the names of the meshes associated with the elements.
120      ESCRIPTEXPORT_DLL_API      WEIPA_DLL_API
121      StringVec getMeshNames() const;      StringVec getMeshNames() const;
122    
123      /// \brief Returns a vector with the mesh variable names.      /// \brief Returns a vector with the mesh variable names.
124      ESCRIPTEXPORT_DLL_API      WEIPA_DLL_API
125      StringVec getVarNames() const;      StringVec getVarNames() const;
126    
127      /// \brief Returns the number of elements.      /// \brief Returns the number of elements.
128      ESCRIPTEXPORT_DLL_API      WEIPA_DLL_API
129      int getNumElements() const { return numElements; }      int getNumElements() const { return numElements; }
130    
131      /// \brief Returns the number of nodes per element.      /// \brief Returns the number of nodes per element.
132      ESCRIPTEXPORT_DLL_API      WEIPA_DLL_API
133      int getNodesPerElement() const { return nodesPerElement; }      int getNodesPerElement() const { return nodesPerElement; }
134    
135      /// \brief Returns the number of "ghost" elements.      /// \brief Returns the number of "ghost" elements.
136      ESCRIPTEXPORT_DLL_API      WEIPA_DLL_API
137      int getGhostCount() const { return numGhostElements; }      int getGhostCount() const { return numGhostElements; }
138    
139      /// \brief Returns the type of the elements.      /// \brief Returns the type of the elements.
140      ESCRIPTEXPORT_DLL_API      WEIPA_DLL_API
141      ZoneType getType() const { return type; }      ZoneType getType() const { return type; }
142    
143      /// \brief Returns the original type id of the Finley reference elements.      /// \brief Returns the original type id of the Finley reference elements.
144      ESCRIPTEXPORT_DLL_API      WEIPA_DLL_API
145      ElementTypeId getFinleyTypeId() const { return finleyTypeId; }      ElementTypeId getFinleyTypeId() const { return finleyTypeId; }
146    
147      /// \brief Returns a vector of the node IDs used by the elements.      /// \brief Returns a vector of the node IDs used by the elements.
148      ESCRIPTEXPORT_DLL_API      WEIPA_DLL_API
149      const IntVec& getNodeList() const { return nodes; }      const IntVec& getNodeList() const { return nodes; }
150    
151      /// \brief Returns a vector of element IDs.      /// \brief Returns a vector of element IDs.
152      ESCRIPTEXPORT_DLL_API      WEIPA_DLL_API
153      const IntVec& getIDs() const { return ID; }      const IntVec& getIDs() const { return ID; }
154    
155      /// \brief Returns an array of data values for the name provided.      /// \brief Returns an array of data values for the name provided.
156      ///      ///
157      /// The name must be one of the names returned from getVarNames().      /// The name must be one of the names returned from getVarNames().
158      ESCRIPTEXPORT_DLL_API      WEIPA_DLL_API
159      const IntVec& getVarDataByName(const std::string varName) const;      const IntVec& getVarDataByName(const std::string varName) const;
160    
161      /// \brief Returns the node mesh instance used by the elements.      /// \brief Returns the node mesh instance used by the elements.
162      ESCRIPTEXPORT_DLL_API      WEIPA_DLL_API
163      NodeData_ptr getNodeMesh() const { return nodeMesh; }      NodeData_ptr getNodeMesh() const { return nodeMesh; }
164    
165      /// \brief Returns the reduced elements.      /// \brief Returns the reduced elements.
166      ESCRIPTEXPORT_DLL_API      WEIPA_DLL_API
167      ElementData_ptr getReducedElements() const { return reducedElements; }      ElementData_ptr getReducedElements() const { return reducedElements; }
168    
169      /// \brief Returns a QuadMaskInfo structure for given functionspace code.      /// \brief Returns a QuadMaskInfo structure for given functionspace code.
# Line 199  private: Line 199  private:
199      int elementFactor;      int elementFactor;
200  };  };
201    
202  } // namespace escriptexport  } // namespace weipa
203    
204  #endif // __ELEMENTDATA_H__  #endif // __ELEMENTDATA_H__
205    

Legend:
Removed from v.3035  
changed lines
  Added in v.3037

  ViewVC Help
Powered by ViewVC 1.1.26