36 #ifndef ABSTRACTTETRAHEDRALMESH_HPP_ 37 #define ABSTRACTTETRAHEDRALMESH_HPP_ 42 #include <boost/serialization/vector.hpp> 43 #include <boost/serialization/base_object.hpp> 44 #include <boost/serialization/split_member.hpp> 49 #include <boost/foreach.hpp> 51 #include "AbstractMesh.hpp" 52 #include "BoundaryElement.hpp" 53 #include "Element.hpp" 54 #include "GenericMeshReader.hpp" 55 #include "AbstractMeshReader.hpp" 56 #include "TrianglesMeshReader.hpp" 57 #include "TrianglesMeshWriter.hpp" 58 #include "ArchiveLocationInfo.hpp" 59 #include "FileFinder.hpp" 63 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
70 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
74 friend class CentroidWriter;
104 friend class boost::serialization::access;
117 template<
class Archive>
118 void save(Archive & archive,
const unsigned int version)
const 120 archive & boost::serialization::base_object<AbstractMesh<ELEMENT_DIM,SPACE_DIM> >(*this);
131 archive & permutation_available;
133 if (permutation_available)
136 archive & rPermutation;
145 unsigned order_of_element = (mMeshIsLinear?1:2);
146 unsigned& order_of_boundary_element = order_of_element;
150 std::shared_ptr<AbstractMeshReader<ELEMENT_DIM, SPACE_DIM> > p_original_mesh_reader
151 = GenericMeshReader<ELEMENT_DIM, SPACE_DIM>(original_file, order_of_element, order_of_boundary_element);
153 if (p_original_mesh_reader->IsFileFormatBinary())
161 std::vector<FileFinder> mesh_files = mesh_folder.
FindMatches(mesh_leaf_name +
".*");
163 BOOST_FOREACH(
const FileFinder& r_mesh_file, mesh_files)
189 template<
class Archive>
190 void load(Archive & archive,
const unsigned int version)
192 archive & boost::serialization::base_object<AbstractMesh<ELEMENT_DIM,SPACE_DIM> >(*this);
195 bool permutation_available=
false;
196 std::vector<unsigned> permutation;
200 archive & permutation_available;
202 if (permutation_available)
204 archive & permutation;
227 p_our_factory =
nullptr;
235 if (permutation_available)
272 BOOST_SERIALIZATION_SPLIT_MEMBER()
277 std::vector<Element<ELEMENT_DIM, SPACE_DIM> *>
mElements;
301 class ElementIterator;
437 double& rJacobianDeterminant,
438 c_matrix<double, ELEMENT_DIM, SPACE_DIM>& rInverseJacobian)
const;
449 c_vector<double, SPACE_DIM>& rWeightedDirection,
450 double& rJacobianDeterminant)
const;
503 virtual void ConstructCuboid(
unsigned width,
unsigned height,
unsigned depth);
587 std::vector<std::vector<unsigned> >& rNodesToReceivePerProcess);
615 std::set<unsigned> testElements=std::set<unsigned>(),
616 bool onlyTryWithTestElements =
false);
624 std::set<unsigned> testElements);
674 bool skipDeletedElements=
true);
681 typename std::vector<Element<ELEMENT_DIM, SPACE_DIM> *>::iterator
mElementIter;
703 namespace serialization {
710 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
724 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
726 bool skipDeletedElements)
731 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
737 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
744 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
751 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
757 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
769 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
773 bool skipDeletedElements)
793 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
799 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
ElementIterator GetElementIteratorBegin(bool skipDeletedElements=true)
virtual unsigned GetNumBoundaryElements() const
#define TEMPLATED_CLASS_IS_ABSTRACT_2_UNSIGNED(T)
std::vector< Element< ELEMENT_DIM, SPACE_DIM > * > mElements
bool operator!=(const typename AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ElementIterator &rOther)
virtual unsigned GetNumLocalBoundaryElements() const
#define ABORT_IF_THROWS(block)
bool mSkipDeletedElements
BoundaryElementIterator GetBoundaryElementIteratorBegin() const
static std::string GetMeshFilename()
virtual unsigned GetMaximumNodeIndex()
virtual bool CalculateDesignatedOwnershipOfBoundaryElement(unsigned faceIndex)
const std::vector< unsigned > & rGetNodePermutation() const
ElementIterator GetElementIteratorEnd()
void ConstructRegularSlabMesh(double spaceStep, double width, double height=0, double depth=0)
void load(Archive &archive, const unsigned int version)
virtual unsigned GetNumElements() const
virtual unsigned GetNumCableElements() const
unsigned CalculateMaximumNodeConnectivityPerProcess() const
Element< ELEMENT_DIM, SPACE_DIM > * GetElement(unsigned index) const
AbstractTetrahedralMesh()
FileFinder CopyTo(const FileFinder &rDest) const
std::vector< Element< ELEMENT_DIM, SPACE_DIM > * >::iterator mElementIter
Element< ELEMENT_DIM, SPACE_DIM > & operator*()
std::string GetMeshFileBaseName() const
void CheckOutwardNormals()
virtual void GetHaloNodeIndices(std::vector< unsigned > &rHaloIndices) const
DistributedVectorFactory * GetOriginalFactory()
virtual void GetInverseJacobianForElement(unsigned elementIndex, c_matrix< double, SPACE_DIM, ELEMENT_DIM > &rJacobian, double &rJacobianDeterminant, c_matrix< double, ELEMENT_DIM, SPACE_DIM > &rInverseJacobian) const
virtual unsigned GetNumLocalElements() const
virtual unsigned SolveElementMapping(unsigned index) const =0
Element< ELEMENT_DIM, SPACE_DIM > * operator->()
bool mMeshChangesDuringSimulation
DistributedVectorFactory * mpDistributedVectorFactory
virtual void GetWeightedDirectionForBoundaryElement(unsigned elementIndex, c_vector< double, SPACE_DIM > &rWeightedDirection, double &rJacobianDeterminant) const
ElementIterator(AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh, typename std::vector< Element< ELEMENT_DIM, SPACE_DIM > * >::iterator elementIter, bool skipDeletedElements=true)
std::vector< BoundaryElement< ELEMENT_DIM-1, SPACE_DIM > * > mBoundaryElements
void SetNodePermutation(std::vector< unsigned > &rPermutationVector)
std::string GetExtension() const
#define CHASTE_VERSION_CONTENT(N)
virtual unsigned GetNumVertices() const
void SetFromFactory(DistributedVectorFactory *pFactory)
AbstractTetrahedralMesh & mrMesh
unsigned GetContainingElementIndex(const ChastePoint< SPACE_DIM > &rTestPoint, bool strict=false, std::set< unsigned > testElements=std::set< unsigned >(), bool onlyTryWithTestElements=false)
virtual void ConstructRectangularMesh(unsigned width, unsigned height, bool stagger=true)
std::vector< FileFinder > FindMatches(const std::string &rPattern) const
bool IsMeshOnDisk() const
BoundaryElement< ELEMENT_DIM-1, SPACE_DIM > * GetBoundaryElement(unsigned index) const
virtual void ConstructCuboid(unsigned width, unsigned height, unsigned depth)
void SetElementOwnerships()
unsigned GetNumAllElements() const
virtual void ConstructFromMeshReader(AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader)=0
FileFinder GetParent() const
void CalculateNodeExchange(std::vector< std::vector< unsigned > > &rNodesToSendPerProcess, std::vector< std::vector< unsigned > > &rNodesToReceivePerProcess)
Forward declaration which is going to be used for friendship.
unsigned GetNumAllBoundaryElements() const
gcov doesn't like this file...
std::string GetLeafNameNoExtension() const
void save(Archive &archive, const unsigned int version) const
virtual unsigned SolveBoundaryElementMapping(unsigned index) const =0
unsigned GetNearestElementIndexFromTestElements(const ChastePoint< SPACE_DIM > &rTestPoint, std::set< unsigned > testElements)
virtual bool CalculateDesignatedOwnershipOfElement(unsigned elementIndex)
void SetWriteFilesAsBinary()
virtual void SetDistributedVectorFactory(DistributedVectorFactory *pFactory)
virtual void ConstructLinearMesh(unsigned width)
std::vector< BoundaryElement< ELEMENT_DIM-1, SPACE_DIM > * >::const_iterator BoundaryElementIterator
static std::string GetArchiveDirectory()
virtual void WriteFilesUsingMesh(AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh, bool keepOriginalElementIndexing=true)
ElementIterator & operator++()
unsigned GetNumProcs() const
static std::string GetArchiveRelativePath()
virtual c_vector< double, 2 > CalculateMinMaxEdgeLengths()
void ConstructFromMesh(AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rOtherMesh)
virtual ~AbstractTetrahedralMesh()
void ConstructRegularSlabMeshWithDimensionSplit(unsigned dimension, double spaceStep, double width, double height=0, double depth=0)
void WriteFilesUsingMeshReaderAndMesh(AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh)
BoundaryElementIterator GetBoundaryElementIteratorEnd() const