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 #include "TrianglesMeshReader.hpp"
00034
00035 #include <vector>
00036
00037 template<unsigned DIM>
00038 class QuadraticMesh : public TetrahedralMesh<DIM, DIM>
00039 {
00040 private:
00045 std::vector<bool> mIsInternalNode;
00046
00048 unsigned mNumVertices;
00049
00053 void LoadFromFile(const std::string& fileName);
00054
00060 void AddNodeToBoundaryElement(BoundaryElement<DIM-1,DIM>* pBoundaryElement,
00061 Element<DIM,DIM>* pElement,
00062 unsigned internalNode);
00063
00069 void AddExtraBoundaryNodes(BoundaryElement<DIM-1,DIM>* pBoundaryElement,
00070 Element<DIM,DIM>* pElement,
00071 unsigned nodeIndexOppositeToFace);
00072
00073
00074
00075 void HelperMethod1(unsigned boundaryElemNode0, unsigned boundaryElemNode1,
00076 Element<DIM,DIM>* pElement,
00077 unsigned node0, unsigned node1, unsigned node2,
00078 unsigned& rOffset,
00079 bool& rReverse);
00080
00081 void HelperMethod2(BoundaryElement<DIM-1,DIM>* pBoundaryElement,
00082 Element<DIM,DIM>* pElement,
00083 unsigned internalNode0, unsigned internalNode1, unsigned internalNode2,
00084 unsigned offset,
00085 bool reverse);
00086
00090 void RunMesherAndReadMesh(std::string binary, std::string outputDir, std::string fileStem);
00091
00092
00093 public:
00099 QuadraticMesh(const std::string& fileName);
00100
00102
00108 QuadraticMesh(double xEnd, double yEnd, unsigned numElemX, unsigned numElemY);
00109
00115 QuadraticMesh(double xEnd, double yEnd, double zEnd,
00116 unsigned numElemX, unsigned numElemY, unsigned numElemZ);
00117
00121 unsigned GetNumVertices()
00122 {
00123 return mNumVertices;
00124 }
00125 };
00126
00127
00128 #endif