36#ifndef NODESONLYMESH_HPP_
37#define NODESONLYMESH_HPP_
40#include <boost/serialization/base_object.hpp>
41#include <boost/serialization/map.hpp>
45#include "DistributedBoxCollection.hpp"
46#include "MutableMesh.hpp"
51template<
unsigned SPACE_DIM>
56 friend class TestNodesOnlyMesh;
72 template<
class Archive>
73 void save(Archive & archive,
const unsigned int version)
const
79 archive & boost::serialization::base_object<MutableMesh<SPACE_DIM, SPACE_DIM> >(*this);
93 template<
class Archive>
94 void load(Archive & archive,
const unsigned int version)
98 std::vector<unsigned> indices;
100 archive & boost::serialization::base_object<MutableMesh<SPACE_DIM, SPACE_DIM> >(*this);
104 for (
unsigned i=0; i<this->
mNodes.size(); i++)
106 unsigned new_index = indices[i];
107 this->
mNodes[i]->SetIndex(new_index);
113 BOOST_SERIALIZATION_SPLIT_MEMBER()
222 virtual
void SetUpBoxCollection(
double cutOffLength, c_vector<
double, 2*SPACE_DIM> domainSize,
int numLocalRows = PETSC_DECIDE, c_vector<
bool,SPACE_DIM> isDimPeriodic = zero_vector<
bool>(SPACE_DIM));
299 bool IsOwned(c_vector<
double, SPACE_DIM>& location);
332 double GetWidth(const
unsigned& rDimension) const;
442 void SetNode(
unsigned nodeIndex,
ChastePoint<SPACE_DIM> point,
bool concreteMove = false);
499#include "SerializationExportWrapper.hpp"
#define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS)
std::vector< Node< SPACE_DIM > * > mNodes
void ClearBoxCollection()
void save(Archive &archive, const unsigned int version) const
void AddMovedNode(boost::shared_ptr< Node< SPACE_DIM > > pMovedNode)
void ConstructNodesWithoutMesh(const std::vector< Node< SPACE_DIM > * > &rNodes, double maxInteractionDistance)
double GetMaximumInteractionDistance()
void EnlargeBoxCollection()
unsigned GetNumNodes() const
virtual unsigned GetMaximumNodeIndex()
void AddNodeWithFixedIndex(Node< SPACE_DIM > *pNewNode)
void SetMaximumInteractionDistance(double maxDistance)
unsigned AddNode(Node< SPACE_DIM > *pNewNode)
void DeleteNode(unsigned index)
unsigned GetNextAvailableIndex()
void UpdateBoxCollection()
std::vector< unsigned > GetAllNodeIndices() const
void CalculateNodesOutsideLocalDomain()
void SetInitialBoxCollection(const c_vector< double, 2 *SPACE_DIM > domainSize, double maxInteractionDistance)
DistributedBoxCollection< SPACE_DIM > * GetBoxCollection()
std::vector< bool > & rGetInitiallyOwnedNodes()
void SetUpBoxCollection(const std::vector< Node< SPACE_DIM > * > &rNodes)
void SetCalculateNodeNeighbours(bool calculateNodeNeighbours)
std::map< unsigned, unsigned > mNodesMapping
void ConstructFromMeshReader(AbstractMeshReader< SPACE_DIM, SPACE_DIM > &rMeshReader)
void SetNode(unsigned nodeIndex, ChastePoint< SPACE_DIM > point, bool concreteMove=false)
Node< SPACE_DIM > * GetNodeOrHaloNode(unsigned index) const
std::vector< bool > mLocalInitialNodes
std::vector< unsigned > mNodesToSendRight
bool IsANodeCloseToDomainBoundary()
std::vector< unsigned > & rGetHaloNodesToSendRight()
bool mCalculateNodeNeighbours
double GetWidth(const unsigned &rDimension) const
void RemoveDeletedNodes(NodeMap &map)
void load(Archive &archive, const unsigned int version)
std::vector< unsigned > & rGetNodesToSendLeft()
unsigned SolveNodeMapping(unsigned index) const
double mMinimumNodeDomainBoundarySeparation
void CalculateBoundaryNodePairs(std::vector< std::pair< Node< SPACE_DIM > *, Node< SPACE_DIM > * > > &rNodePairs)
void ResizeBoxCollection()
void SetMinimumNodeDomainBoundarySeparation(double separation)
void AddHaloNode(boost::shared_ptr< Node< SPACE_DIM > > pNewNode)
std::vector< boost::shared_ptr< Node< SPACE_DIM > > > mHaloNodes
unsigned mMaxAddedNodeIndex
std::vector< unsigned > mNodesToSendLeft
std::vector< unsigned > & rGetHaloNodesToSendLeft()
void AddHaloNodesToBoxes()
void DeleteMovedNode(unsigned index)
friend class boost::serialization::access
DistributedBoxCollection< SPACE_DIM > * mpBoxCollection
void CalculateInteriorNodePairs(std::vector< std::pair< Node< SPACE_DIM > *, Node< SPACE_DIM > * > > &rNodePairs)
bool GetIsPeriodicAcrossProcsFromBoxCollection() const
bool IsOwned(c_vector< double, SPACE_DIM > &location)
double mMaximumInteractionDistance
std::vector< unsigned > mDeletedGlobalNodeIndices
std::map< unsigned, unsigned > mHaloNodesMapping
std::vector< unsigned > & rGetNodesToSendRight()