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

Diff of /trunk/tools/libescriptreader/src/escriptreader/Mesh.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 25  namespace EscriptReader { Line 25  namespace EscriptReader {
25    
26  class ElementData;  class ElementData;
27    
28  //  /// \brief
 //  
 //  
29  class Mesh  class Mesh
30  {  {
31  public:  public:
32      /// Constructor with mesh coordinates, dimensionality and size      /// \brief Constructor with mesh coordinates, dimensionality and size.
33      Mesh(CoordArray c, int nDims, int nNodes);      Mesh(CoordArray c, int nDims, int nNodes);
34    
35      /// Copy constructor      /// \brief Copy constructor.
36      Mesh(const Mesh& m);      Mesh(const Mesh& m);
37    
38      /// Virtual destructor      /// \brief Virtual destructor
39      virtual ~Mesh();      virtual ~Mesh();
40    
41      virtual bool readFromNc(const std::string& ncFile);      virtual bool readFromNc(const std::string& ncFile);
# Line 49  public: Line 47  public:
47      void setSiloPath(const std::string& p) { siloPath = p; }      void setSiloPath(const std::string& p) { siloPath = p; }
48      std::string getSiloPath() const { return siloPath; }      std::string getSiloPath() const { return siloPath; }
49    
50      /// Returns full Silo mesh name, e.g. "/block0000/Elements"      /// \brief Returns full Silo mesh name, e.g. "/block0000/Elements".
51      std::string getFullSiloName() const;      std::string getFullSiloName() const;
52    
53      const IntVec& getNodeIDs() const { return nodeID; }      const IntVec& getNodeIDs() const { return nodeID; }
# Line 58  public: Line 56  public:
56      const IndexMap& getIndexMap() const { return nodeID2idx; }      const IndexMap& getIndexMap() const { return nodeID2idx; }
57      void setIndexMap(const IndexMap& map) { nodeID2idx = map; }      void setIndexMap(const IndexMap& map) { nodeID2idx = map; }
58    
59        /// \brief Returns an array with the coordinates of the mesh nodes.
60      const CoordArray& getCoords() const { return coords; }      const CoordArray& getCoords() const { return coords; }
61    
62        /// \brief Returns the dimensionality of this mesh (2 or 3).
63      int getNumDims() const { return numDims; }      int getNumDims() const { return numDims; }
64    
65        /// \brief Returns the number of mesh nodes.
66      int getNumNodes() const { return numNodes; }      int getNumNodes() const { return numNodes; }
67    
68  protected:  protected:
69      /// Protected default constructor      /// \brief Protected default constructor.
70      Mesh() {}      Mesh() {}
71            
72      void buildIndexMap();      void buildIndexMap();
73    
74      CoordArray coords;       // x, y[, z] coordinates of mesh nodes      CoordArray coords;       /// x, y[, z] coordinates of mesh nodes
75      int numDims;             // dimensionality of mesh (2 or 3)      int numDims;             /// dimensionality of mesh (2 or 3)
76      int numNodes;            // number of mesh nodes      int numNodes;            /// number of mesh nodes
77      IntVec nodeID;           // node IDs      IntVec nodeID;           /// node IDs
78      IndexMap nodeID2idx;     // mapping of node ID -> array index      IndexMap nodeID2idx;     /// mapping of node ID -> array index
79      std::string name;        // the name of this mesh      std::string name;        /// the name of this mesh
80      std::string siloPath;    // absolute path in Silo file      std::string siloPath;    /// absolute path in Silo file
81  };  };
82    
83    
 //  
 //  
 //  
84  inline void Mesh::buildIndexMap()  inline void Mesh::buildIndexMap()
85  {  {
86      nodeID2idx.clear();      nodeID2idx.clear();

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

  ViewVC Help
Powered by ViewVC 1.1.26