00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef QUADRATICMESH_HPP_
00030 #define QUADRATICMESH_HPP_
00031
00032 #include "TetrahedralMesh.hpp"
00033
00034 #include <vector>
00035
00039 template<unsigned DIM>
00040 class QuadraticMesh : public TetrahedralMesh<DIM, DIM>
00041 {
00042 private:
00043
00048 std::vector<bool> mIsInternalNode;
00049
00051 unsigned mNumVertices;
00052
00061 void LoadFromFile(const std::string& rFileName, bool boundaryElemFileIsQuadratic);
00062
00067 void AddNodesToBoundaryElements();
00068
00078 void AddNodeToBoundaryElement(BoundaryElement<DIM-1,DIM>* pBoundaryElement,
00079 Element<DIM,DIM>* pElement,
00080 unsigned internalNode);
00081
00092 void AddExtraBoundaryNodes(BoundaryElement<DIM-1,DIM>* pBoundaryElement,
00093 Element<DIM,DIM>* pElement,
00094 unsigned nodeIndexOppositeToFace);
00095
00118 void HelperMethod1(unsigned boundaryElemNode0, unsigned boundaryElemNode1,
00119 Element<DIM,DIM>* pElement,
00120 unsigned node0, unsigned node1, unsigned node2,
00121 unsigned& rOffset,
00122 bool& rReverse);
00123
00142 void HelperMethod2(BoundaryElement<DIM-1,DIM>* pBoundaryElement,
00143 Element<DIM,DIM>* pElement,
00144 unsigned internalNode0, unsigned internalNode1, unsigned internalNode2,
00145 unsigned offset,
00146 bool reverse);
00147
00157 void RunMesherAndReadMesh(std::string binary, std::string outputDir, std::string fileStem);
00158
00159 public:
00160
00169 QuadraticMesh(const std::string& rFileName, bool boundaryElemFileIsQuadratic);
00170
00172
00183 QuadraticMesh(double xEnd, double yEnd, unsigned numElemX, unsigned numElemY);
00184
00197 QuadraticMesh(double xEnd, double yEnd, double zEnd,
00198 unsigned numElemX, unsigned numElemY, unsigned numElemZ);
00199
00207 void WriteBoundaryElementFile(std::string directory, std::string fileName);
00208
00212 unsigned GetNumVertices();
00213 };
00214
00215
00216 #endif