|
|
#ifndef MESH_FILE #define MESH_FILE #include#include #include using namespace std; /** We store an f.e. mesh similar to the storage scheme in ParMetis. The numbering starts with 0. */ class Mesh { public: /** */ Mesh(); /** Generate a mesh from a derived connectivity @param con original mesh */ Mesh(const vector< vector > &con); /** Generate a mesh from a given mesh. @param orig original mesh */ Mesh(const Mesh& orig); /** Generate a mesh from those elements of a given mesh @p orig which belongs to a process @ proc. @param proc process number @param elmdist array of process numbers for the elements. @param orig original mesh */ Mesh(const int proc, const int elmdist[], const Mesh& orig); /** Reads the mesh from an ASCII-file. @param filename name of input file The input file contains @p nelem and then in seperate lines the number of nodes in that elements and the list of nodes seperate line. */ Mesh(const string &filename); /** */ ~Mesh(); /** Assign a mesh from a given mesh. @param rhs original mesh */ Mesh& operator=(const Mesh& rhs); /** @return number of elements in mesh */ int numElements() const { return eptr_.size()-1; }; /** @return number of nodes in mesh */ int numNodes() const; /** Convert the mesh into local node numbering. This method should be called after the constructor: Mesh(const int proc, const int elmdist[], const Mesh& orig). @param loc2glob maps local indices to global indices */ void ConvertToLocalNodeNumbering(vector &loc2glob); Mesh DualMesh() const; vector< vector > GetMeshArrays() const; /** Output operator */ friend ostream & operator<<(ostream & s, const Mesh & orig); private: vector eptr_; /** pointer to the begin of an element */ vector eind_; /** sequence of nodes describing the elements */ mutable int nnodes_; /** number of nodes in mesh */ }; //############################################################################## ostream & operator<<(ostream & s, const vector< vector > & orig); bool smaller(const vector & lhs, const vector & rhs); #endif
Generated by: ghaase on mephisto on Fri Apr 11 18:03:43 2008, using kdoc 2.0a54. |