QuadraticMesh.hpp
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
00030
00031
00032
00033
00034
00035
00036 #ifndef QUADRATICMESH_HPP_
00037 #define QUADRATICMESH_HPP_
00038
00039 #include "ChasteSerialization.hpp"
00040 #include <boost/serialization/base_object.hpp>
00041 #include <map>
00042 #include <vector>
00043
00044 #include "TetrahedralMesh.hpp"
00045 #include "TrianglesMeshReader.hpp"
00046
00050 template<unsigned DIM>
00051 class QuadraticMesh : public TetrahedralMesh<DIM, DIM>
00052 {
00053 friend class TestQuadraticMesh;
00054 protected:
00055
00057 unsigned mNumVertices;
00058
00062 void CountVertices();
00063
00065 friend class boost::serialization::access;
00072 template<class Archive>
00073 void serialize(Archive & archive, const unsigned int version)
00074 {
00075 archive & boost::serialization::base_object<TetrahedralMesh<DIM, DIM> >(*this);
00076 }
00077
00078
00088 void ConstructLinearMesh(unsigned numElemX);
00089
00090
00104 void ConstructRectangularMesh(unsigned numElemX, unsigned numElemY, bool stagger=true);
00105
00106
00117 void ConstructCuboid(unsigned numElemX, unsigned numElemY, unsigned numElemZ);
00118
00130 Node<DIM>* MakeNewInternalNode(unsigned& rIndex, c_vector<double, DIM>& rLocation, c_vector<double, DIM>& rTop);
00131
00143 unsigned LookupInternalNode(unsigned globalIndex1, unsigned globalIndex2, std::map<std::pair<unsigned, unsigned>, unsigned>& rEdgeMap);
00144
00145
00146 public:
00147
00152 QuadraticMesh()
00153 {
00154 this->mMeshIsLinear=false;
00155 }
00156
00157
00168 QuadraticMesh(double spaceStep, double width, double height=0, double depth=0);
00169
00170
00176 void ConstructFromMeshReader(AbstractMeshReader<DIM, DIM>& rMeshReader);
00177
00185 void ConstructFromLinearMeshReader(AbstractMeshReader<DIM, DIM>& rMeshReader);
00186
00190 unsigned GetNumVertices() const;
00191 };
00192
00193 #include "SerializationExportWrapper.hpp"
00194 EXPORT_TEMPLATE_CLASS_SAME_DIMS(QuadraticMesh)
00195
00196
00197 #endif