QuadraticMesh.hpp

00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2009
00004 
00005 University of Oxford means the Chancellor, Masters and Scholars of the
00006 University of Oxford, having an administrative office at Wellington
00007 Square, Oxford OX1 2JD, UK.
00008 
00009 This file is part of Chaste.
00010 
00011 Chaste is free software: you can redistribute it and/or modify it
00012 under the terms of the GNU Lesser General Public License as published
00013 by the Free Software Foundation, either version 2.1 of the License, or
00014 (at your option) any later version.
00015 
00016 Chaste is distributed in the hope that it will be useful, but WITHOUT
00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
00019 License for more details. The offer of Chaste under the terms of the
00020 License is subject to the License being interpreted in accordance with
00021 English Law and subject to any action against the University of Oxford
00022 being under the jurisdiction of the English Courts.
00023 
00024 You should have received a copy of the GNU Lesser General Public License
00025 along with Chaste. If not, see <http://www.gnu.org/licenses/>.
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 /*QUADRATICMESH_HPP_*/

Generated on Tue Aug 4 16:10:22 2009 for Chaste by  doxygen 1.5.5