Chaste Commit::ca8ccdedf819b6e02855bc0e8e6f50bdecbc5208
|
#include <ImmersedBoundaryMesh.hpp>
Classes | |
class | ImmersedBoundaryElementIterator |
class | ImmersedBoundaryLaminaIterator |
Protected Member Functions | |
unsigned | SolveNodeMapping (unsigned index) const |
unsigned | SolveElementMapping (unsigned index) const |
unsigned | SolveBoundaryElementMapping (unsigned index) const |
void | TagBoundaryElements () |
unsigned | DivideElement (ImmersedBoundaryElement< ELEMENT_DIM, SPACE_DIM > *pElement, unsigned nodeAIndex, unsigned nodeBIndex, c_vector< double, SPACE_DIM > centroid, c_vector< double, SPACE_DIM > axisOfDivision) |
template<class Archive > | |
void | save (Archive &archive, const unsigned int version) const |
template<class Archive > | |
void | load (Archive &archive, const unsigned int version) |
Protected Member Functions inherited from AbstractMesh< ELEMENT_DIM, SPACE_DIM > | |
virtual void | SetElementOwnerships () |
ChasteCuboid< SPACE_DIM > | CalculateBoundingBox (const std::vector< Node< SPACE_DIM > * > &rNodes) const |
Static Protected Attributes | |
static constexpr double | mVoronoiHalo = 0.1 |
Friends | |
class | TestImmersedBoundaryMesh |
class | boost::serialization::access |
Additional Inherited Members | |
Public Types inherited from AbstractMesh< ELEMENT_DIM, SPACE_DIM > | |
typedef std::vector< Node< SPACE_DIM > * >::const_iterator | BoundaryNodeIterator |
An immersed boundary mesh class, in which elements may contain different numbers of nodes. This is facilitated by the ImmersedBoundaryElement class.
This class allows immersed boundary simulations.
Definition at line 69 of file ImmersedBoundaryMesh.hpp.
ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::ImmersedBoundaryMesh | ( | std::vector< Node< SPACE_DIM > * > | nodes, |
std::vector< ImmersedBoundaryElement< ELEMENT_DIM, SPACE_DIM > * > | elements, | ||
std::vector< ImmersedBoundaryElement< ELEMENT_DIM - 1, SPACE_DIM > * > | laminas = {} , |
||
unsigned | numGridPtsX = 128u , |
||
unsigned | numGridPtsY = 128u |
||
) |
Default constructor.
nodes | vector of pointers to nodes |
elements | vector of pointers to ImmersedBoundaryElements |
laminas | vector of pointers to lamina ImmersedBoundaryElements |
numGridPtsX | the number of grid points in the x direction |
numGridPtsY | the number of grid points in the y direction |
Definition at line 49 of file ImmersedBoundaryMesh.cpp.
References ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::Clear(), EXCEPTION, ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetCentroidOfElement(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetSurfaceAreaOfElement(), ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::m2dVelocityGrids, ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::mCharacteristicNodeSpacing, ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::mElementFluidSources, ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::mElements, ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::mLaminas, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::mNumGridPtsX, ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::mNumGridPtsY, and NEVER_REACHED.
ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::ImmersedBoundaryMesh | ( | ) |
Default constructor for use by serializer.
Definition at line 515 of file ImmersedBoundaryMesh.cpp.
|
virtual |
Destructor.
Definition at line 522 of file ImmersedBoundaryMesh.cpp.
unsigned ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::AddNode | ( | Node< SPACE_DIM > * | pNewNode | ) |
Add a node to the mesh
pNewNode | a pointer to the node to be added to the mesh. |
Definition at line 694 of file ImmersedBoundaryMesh.cpp.
ChasteCuboid< SPACE_DIM > ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::CalculateBoundingBoxOfElement | ( | unsigned | index | ) |
Calculate the bounding box of an element specified by its index.
index | the index of the element |
Definition at line 476 of file ImmersedBoundaryMesh.cpp.
double ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::CalculateLengthOfVoronoiEdge | ( | const boost::polygon::voronoi_diagram< double >::edge_type & | rEdge | ) |
Get the length of an edge in the voronoi diagram mNodeLocationsVoronoiDiagram. This gives the "real" length after undoing the scaling required when calculating the diagram.
rEdge | the edge to calculate the length of |
Definition at line 1933 of file ImmersedBoundaryMesh.cpp.
|
virtual |
Compute the second moments and product moment of area for a given 2D element about its centroid. These are:
I_xx, the second moment of area about an axis through the centroid of the element parallel to the x-axis;
I_yy, the second moment of area about an axis through the centroid of the element parallel to the y-axis;
and I_xy, product moment of area through the centroid of the element.
Formulae for these quantities may be found e.g. in the following reference:
Mechanics of Materials James M. Gere (Author), Barry J. Goodno. Cengage Learning; 8th edition (January 1, 2012)
This method is used within GetShortAxisOfElement() to compute the direction of the shortest principal axis passing through the centroid, or 'short axis', of the element.
Note that by definition, the second moments of area must be non-negative, while the product moment of area may not be.
index | the global index of a specified immersed boundary element |
Definition at line 1180 of file ImmersedBoundaryMesh.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and NEVER_REACHED.
|
virtual |
Delete mNodes, mFaces and mElements.
Definition at line 578 of file ImmersedBoundaryMesh.cpp.
Referenced by ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::ImmersedBoundaryMesh().
void ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::ConformToGeometry | ( | c_vector< double, SPACE_DIM > & | rLocation | ) |
Transform a location so that it lies within the domain [0,1)x[0,1). This method assumes the location is already 'close' to the domain, for instance because a location has previously been 'straightened out' for geometric calculations that require no looping due to periodicity.
rLocation | the location to transform |
Definition at line 1819 of file ImmersedBoundaryMesh.cpp.
void ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::ConstructFromMeshReader | ( | AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > & | rMeshReader | ) |
Construct the mesh using a MeshReader.
rMeshReader | the mesh reader |
Referenced by ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::load().
|
protected |
Divide an element along the axis passing through two of its nodes.
pElement | the element to divide |
nodeAIndex | the local index of one node within this element |
nodeBIndex | the local index of another node within this element |
centroid | the centroid of the element being divided |
axisOfDivision | the specified division axis |
Definition at line 1369 of file ImmersedBoundaryMesh.cpp.
References DOUBLE_UNSET, EXCEPTION, ImmersedBoundaryElement< ELEMENT_DIM, SPACE_DIM >::GetFluidSource(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumElementAttributes(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), NEVER_REACHED, ImmersedBoundaryElement< ELEMENT_DIM, SPACE_DIM >::rGetCornerNodes(), and AbstractElement< ELEMENT_DIM, SPACE_DIM >::rGetElementAttributes().
unsigned ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::DivideElementAlongGivenAxis | ( | ImmersedBoundaryElement< ELEMENT_DIM, SPACE_DIM > * | pElement, |
c_vector< double, SPACE_DIM > | axisOfDivision, | ||
bool | placeOriginalElementBelow = false |
||
) |
Divide an element along a specified axis.
If the new nodes (intersections of axis with element) are within mCellRearrangementThreshold of existing nodes then they are moved 2*mCellRearrangementThreshold away.
pElement | the element to divide |
axisOfDivision | axis to divide the element by |
placeOriginalElementBelow | whether to place the original element below (in the y direction) the new element (defaults to false) |
Definition at line 1297 of file ImmersedBoundaryMesh.cpp.
References EXCEPTION, AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and NEVER_REACHED.
unsigned ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::DivideElementAlongShortAxis | ( | ImmersedBoundaryElement< ELEMENT_DIM, SPACE_DIM > * | pElement, |
bool | placeOriginalElementBelow = false |
||
) |
Divide an element along its short axis.
pElement | the element to divide |
placeOriginalElementBelow | whether to place the original element below (in the y direction) the new element (defaults to false) |
Definition at line 1353 of file ImmersedBoundaryMesh.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), and NEVER_REACHED.
double ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetAverageNodeSpacingOfElement | ( | unsigned | index, |
bool | recalculate = true |
||
) |
Compute the average node spacing of an element.
index | the global index of a specified immersed boundary element |
recalculate | whether or not to recalculate the value |
Definition at line 1121 of file ImmersedBoundaryMesh.cpp.
References DOUBLE_UNSET.
Referenced by ImmersedBoundaryKinematicFeedbackForce< DIM >::AddImmersedBoundaryForceContribution(), ImmersedBoundaryLinearDifferentialAdhesionForce< DIM >::AddImmersedBoundaryForceContribution(), ImmersedBoundaryLinearInteractionForce< DIM >::AddImmersedBoundaryForceContribution(), ImmersedBoundaryMorseInteractionForce< DIM >::AddImmersedBoundaryForceContribution(), ImmersedBoundaryLinearMembraneForce< DIM >::CalculateForcesOnElement(), ImmersedBoundaryMorseMembraneForce< DIM >::CalculateForcesOnElement(), and ImmersedBoundarySvgWriter< DIM >::UpdateAtEndOfTimeStep().
double ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetAverageNodeSpacingOfLamina | ( | unsigned | index, |
bool | recalculate = true |
||
) |
Compute the average node spacing of a lamina.
index | the global index of a specified immersed boundary lamina |
recalculate | whether or not to recalculate the value |
Definition at line 1137 of file ImmersedBoundaryMesh.cpp.
References DOUBLE_UNSET.
Referenced by ImmersedBoundaryLinearInteractionForce< DIM >::AddImmersedBoundaryForceContribution(), ImmersedBoundaryMorseInteractionForce< DIM >::AddImmersedBoundaryForceContribution(), ImmersedBoundaryLinearMembraneForce< DIM >::CalculateForcesOnElement(), and ImmersedBoundaryMorseMembraneForce< DIM >::CalculateForcesOnElement().
double ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetCellRearrangementThreshold | ( | ) |
Definition at line 709 of file ImmersedBoundaryMesh.cpp.
|
virtual |
Compute the centroid of an element.
A formula for the centroid of a plane polygon may be found e.g. in the following reference:
Mechanics of Materials James M. Gere (Author), Barry J. Goodno. Cengage Learning; 8th edition (January 1, 2012)
This needs to be overridden in daughter classes for non-Euclidean metrics.
index | the global index of a specified immersed boundary element |
Definition at line 792 of file ImmersedBoundaryMesh.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and NEVER_REACHED.
Referenced by ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::ImmersedBoundaryMesh().
double ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetCharacteristicNodeSpacing | ( | ) | const |
Definition at line 606 of file ImmersedBoundaryMesh.cpp.
ImmersedBoundaryElement< ELEMENT_DIM, SPACE_DIM > * ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetElement | ( | unsigned | index | ) | const |
index | the global index of a specified immersed boundary element. |
Definition at line 766 of file ImmersedBoundaryMesh.cpp.
Referenced by CellPopulationElementWriter< ELEMENT_DIM, SPACE_DIM >::Visit().
double ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetElementDivisionSpacing | ( | ) |
Definition at line 1164 of file ImmersedBoundaryMesh.cpp.
|
inline |
skipDeletedElements | whether to include deleted elements |
Definition at line 923 of file ImmersedBoundaryMesh.hpp.
Referenced by ImmersedBoundaryLinearMembraneForce< DIM >::AddImmersedBoundaryForceContribution(), ImmersedBoundaryMorseMembraneForce< DIM >::AddImmersedBoundaryForceContribution(), ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::FindElementOverlaps(), and ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::MakeVtkMesh().
|
inline |
Definition at line 930 of file ImmersedBoundaryMesh.hpp.
Referenced by ImmersedBoundaryLinearMembraneForce< DIM >::AddImmersedBoundaryForceContribution(), ImmersedBoundaryMorseMembraneForce< DIM >::AddImmersedBoundaryForceContribution(), ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::FindElementOverlaps(), and ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::MakeVtkMesh().
double ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetElongationShapeFactorOfElement | ( | unsigned | elementIndex | ) |
Get the elongation shape factor of a given element. This is defined as the square root of the ratio of the two second moments of the element around its principal axes.
elementIndex | index of an element in the mesh |
Definition at line 175 of file ImmersedBoundaryMesh.cpp.
ImmersedBoundaryElement< ELEMENT_DIM - 1, SPACE_DIM > * ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetLamina | ( | unsigned | index | ) | const |
index | the global index of a specified immersed boundary lamina. |
Definition at line 773 of file ImmersedBoundaryMesh.cpp.
|
inline |
skipDeletedLaminas | whether to include deleted laminas |
Definition at line 1007 of file ImmersedBoundaryMesh.hpp.
References ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::mLaminas.
Referenced by ImmersedBoundaryLinearMembraneForce< DIM >::AddImmersedBoundaryForceContribution(), ImmersedBoundaryMorseMembraneForce< DIM >::AddImmersedBoundaryForceContribution(), and ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::MakeVtkMesh().
|
inline |
Definition at line 1014 of file ImmersedBoundaryMesh.hpp.
References ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::mLaminas.
Referenced by ImmersedBoundaryLinearMembraneForce< DIM >::AddImmersedBoundaryForceContribution(), ImmersedBoundaryMorseMembraneForce< DIM >::AddImmersedBoundaryForceContribution(), and ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::MakeVtkMesh().
unsigned ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetMaxElementIndex | ( | ) | const |
Definition at line 1963 of file ImmersedBoundaryMesh.cpp.
unsigned ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetMaxLaminaIndex | ( | ) | const |
Definition at line 1984 of file ImmersedBoundaryMesh.cpp.
unsigned ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetMaxNodeIndex | ( | ) | const |
Definition at line 1944 of file ImmersedBoundaryMesh.cpp.
double ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetNeighbourDist | ( | ) | const |
Definition at line 780 of file ImmersedBoundaryMesh.cpp.
std::set< unsigned > ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetNeighbouringElementIndices | ( | unsigned | elemIdx | ) |
Given an element index, find a set containing the indices of its neighbouring elements.
elemIdx | global index of the element |
Definition at line 1854 of file ImmersedBoundaryMesh.cpp.
References EXCEPTION.
std::set< unsigned > ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetNeighbouringNodeIndices | ( | unsigned | nodeIndex | ) |
Given a node, find a set containing the indices of its neighbouring nodes.
nodeIndex | global index of the node |
Definition at line 528 of file ImmersedBoundaryMesh.cpp.
unsigned ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetNumAllElements | ( | ) | const |
Definition at line 754 of file ImmersedBoundaryMesh.cpp.
Referenced by ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::FindElementOverlaps().
|
virtual |
Definition at line 748 of file ImmersedBoundaryMesh.cpp.
unsigned ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetNumGridPtsX | ( | ) | const |
Definition at line 624 of file ImmersedBoundaryMesh.cpp.
Referenced by ImmersedBoundary2dArrays< DIM >::ImmersedBoundary2dArrays(), and ImmersedBoundaryFftInterface< DIM >::ImmersedBoundaryFftInterface().
unsigned ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetNumGridPtsY | ( | ) | const |
Definition at line 630 of file ImmersedBoundaryMesh.cpp.
Referenced by ImmersedBoundary2dArrays< DIM >::ImmersedBoundary2dArrays(), and ImmersedBoundaryFftInterface< DIM >::ImmersedBoundaryFftInterface().
unsigned ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetNumLaminas | ( | ) | const |
Definition at line 760 of file ImmersedBoundaryMesh.cpp.
Referenced by ImmersedBoundaryLinearDifferentialAdhesionForce< DIM >::AddImmersedBoundaryForceContribution().
|
virtual |
Reimplemented from AbstractMesh< ELEMENT_DIM, SPACE_DIM >.
Definition at line 742 of file ImmersedBoundaryMesh.cpp.
Referenced by ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::MakeVtkMesh(), and ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh().
std::array< unsigned, 13 > ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetPolygonDistribution | ( | ) |
Calculate the polygon distribution for the mesh: number of {0, 1, 2, 3, 4, 5,..., 12+}-gons. Note that the vector will always begin {0, 0, 0, ...} as there can be no 0, 1, or 2-gons, but this choice means that accessing the nth element of the vector gives you the number of n-gons which seems to be most natural. All 12-sided and higher order polygons are accumulated in the array[12] position.
Definition at line 1908 of file ImmersedBoundaryMesh.cpp.
References NEVER_REACHED.
c_vector< double, SPACE_DIM > ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetShortAxisOfElement | ( | unsigned | index | ) |
Compute the direction of the shortest principal axis passing through the centroid, or 'short axis', of a given element. This is the eigenvector associated with the eigenvalue of largest magnitude of the inertia matrix
J = ( I_xx -I_xy ) ( -I_xy I_yy )
whose entries are computed by calling the method CalculateMomentsOfElement().
Note that if the nodes owned by the element are supplied in clockwise rather than anticlockwise manner, or if this arises when any periodicity is enforced, then the sign of each moment may be incorrect change. This means that we need to consider the eigenvalue of largest magnitude rather than largest value when computing the short axis of the element.
If the element is a regular polygon then the eigenvalues of the inertia tensor are equal: in this case we return a random unit vector.
This method is only implemented in 2D at present.
index | the global index of a specified immersed boundary element |
Definition at line 1239 of file ImmersedBoundaryMesh.cpp.
References RandomNumberGenerator::Instance(), NEVER_REACHED, and RandomNumberGenerator::ranf().
Referenced by ShortAxisImmersedBoundaryDivisionRule< SPACE_DIM >::CalculateCellDivisionVector().
double ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetSkewnessOfElementMassDistributionAboutAxis | ( | unsigned | elemIndex, |
c_vector< double, SPACE_DIM > | axis | ||
) |
Calculate the skewness of the mass-distribution of a given element along a line perpendicular to a given axis, as a measure of element asymmetry.
This method is only valid in 2D.
elemIndex | the index of the element in this mesh |
axis | the axis perpendicular to which the distribution is found |
Definition at line 247 of file ImmersedBoundaryMesh.cpp.
double ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetSpacingRatio | ( | ) | const |
Definition at line 612 of file ImmersedBoundaryMesh.cpp.
|
virtual |
Compute the surface area (or perimeter in 2D) of an element.
This needs to be overridden in daughter classes for non-Euclidean metrics.
index | the global index of a specified immersed boundary element |
Definition at line 1037 of file ImmersedBoundaryMesh.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and NEVER_REACHED.
Referenced by ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::ImmersedBoundaryMesh().
double ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetTortuosityOfMesh | ( | ) |
Compute tortuosity, defined as the ratio of total length to straight-line length, of piecewise linear curve through centroids of successive elements.
Definition at line 203 of file ImmersedBoundaryMesh.cpp.
References NEVER_REACHED.
|
virtual |
Overridden GetVectorFromAtoB() method.
Evaluates the (surface) distance between two points in a periodic geometry.
rLocation1 | the x and y co-ordinates of point 1 |
rLocation2 | the x and y co-ordinates of point 2 |
Reimplemented from AbstractMesh< ELEMENT_DIM, SPACE_DIM >.
Definition at line 715 of file ImmersedBoundaryMesh.cpp.
Referenced by ImmersedBoundaryKinematicFeedbackForce< DIM >::AddImmersedBoundaryForceContribution(), ImmersedBoundaryLinearDifferentialAdhesionForce< DIM >::AddImmersedBoundaryForceContribution(), ImmersedBoundaryLinearInteractionForce< DIM >::AddImmersedBoundaryForceContribution(), ImmersedBoundaryMorseInteractionForce< DIM >::AddImmersedBoundaryForceContribution(), ImmersedBoundaryLinearMembraneForce< DIM >::CalculateForcesOnElement(), ImmersedBoundaryMorseMembraneForce< DIM >::CalculateForcesOnElement(), and ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::MakeVtkMesh().
|
virtual |
Get the volume (or area in 2D, or length in 1D) of an element.
This needs to be overridden in daughter classes for non-Euclidean metrics.
index | the global index of a specified immersed boundary element |
Definition at line 998 of file ImmersedBoundaryMesh.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and NEVER_REACHED.
const std::vector< unsigned int > & ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetVoronoiCellIdsIndexedByNodeIndex | ( | ) | const |
Definition at line 2311 of file ImmersedBoundaryMesh.cpp.
double ImmersedBoundaryMesh< 1, 1 >::GetVoronoiSurfaceAreaOfElement | ( | const unsigned | elemIdx | ) |
Template specialisation for impossible to reach code path
elemIdx | the element index |
Definition at line 1114 of file ImmersedBoundaryMesh.cpp.
double ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetVoronoiSurfaceAreaOfElement | ( | unsigned | elemIdx | ) |
Compute the surface area (or perimeter in 2D) of the Voronoi cell of an element. The voronoi cell of an element is the union of the voronoi cells of all nodes in the element.
elemIdx | the global index of a specified immersed boundary element |
Definition at line 1063 of file ImmersedBoundaryMesh.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and NEVER_REACHED.
|
inlineprotected |
Load a mesh by using ImmersedBoundaryMeshReader and the location in ArchiveLocationInfo.
archive | the archive |
version | the current version of this class |
Definition at line 222 of file ImmersedBoundaryMesh.hpp.
References ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::ConstructFromMeshReader(), ArchiveLocationInfo::GetArchiveDirectory(), and ArchiveLocationInfo::GetMeshFilename().
bool ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::NodesInDifferentElementOrLamina | ( | Node< SPACE_DIM > * | pNodeA, |
Node< SPACE_DIM > * | pNodeB | ||
) |
Determine whether two nodes belong to the same element, or the same lamina
pNodeA | a pointer to a node |
pNodeB | a pointer to a different node |
Definition at line 1839 of file ImmersedBoundaryMesh.cpp.
References Node< SPACE_DIM >::ContainingElementsBegin(), and Node< SPACE_DIM >::GetRegion().
Referenced by ImmersedBoundaryLinearDifferentialAdhesionForce< DIM >::AddImmersedBoundaryForceContribution(), ImmersedBoundaryLinearInteractionForce< DIM >::AddImmersedBoundaryForceContribution(), and ImmersedBoundaryMorseInteractionForce< DIM >::AddImmersedBoundaryForceContribution().
void ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::ReMesh | ( | bool | randomOrder = false | ) |
ReMesh method that evenly redistributes nodes around each element and lamina.
randomOrder | whether to remesh elements and laminas starting from a random location. Defaults to false. |
Definition at line 1666 of file ImmersedBoundaryMesh.cpp.
void ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::ReMeshElement | ( | ImmersedBoundaryElement< ELEMENT_DIM, SPACE_DIM > * | pElement, |
bool | randomOrder | ||
) |
ReMesh method that evenly redistributes nodes around a specific element.
pElement | the element to remesh |
randomOrder | whether to remesh elements and laminas starting from a random location |
Definition at line 1688 of file ImmersedBoundaryMesh.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), RandomNumberGenerator::Instance(), NEVER_REACHED, and RandomNumberGenerator::randMod().
void ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::ReMeshLamina | ( | ImmersedBoundaryElement< ELEMENT_DIM - 1, SPACE_DIM > * | pLamina, |
bool | randomOrder | ||
) |
ReMesh method that evenly redistributes nodes along a specific lamina.
pLamina | the lamina to remesh |
randomOrder | whether to remesh elements and laminas starting from a random location |
Definition at line 1753 of file ImmersedBoundaryMesh.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), RandomNumberGenerator::Instance(), NEVER_REACHED, and RandomNumberGenerator::randMod().
const multi_array< double, 3 > & ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::rGet2dVelocityGrids | ( | ) | const |
Definition at line 682 of file ImmersedBoundaryMesh.cpp.
std::vector< std::shared_ptr< FluidSource< SPACE_DIM > > > & ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::rGetBalancingFluidSources | ( | ) |
Definition at line 676 of file ImmersedBoundaryMesh.cpp.
std::vector< std::shared_ptr< FluidSource< SPACE_DIM > > > & ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::rGetElementFluidSources | ( | ) |
Definition at line 664 of file ImmersedBoundaryMesh.cpp.
multi_array< double, 3 > & ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::rGetModifiable2dVelocityGrids | ( | ) |
Definition at line 688 of file ImmersedBoundaryMesh.cpp.
const boost::polygon::voronoi_diagram< double > & ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::rGetNodeLocationsVoronoiDiagram | ( | bool | update = true | ) |
Get the voronoi diagram of node locations. This may be needed for population writers and others.
update | whether to update the diagram before returning the reference (default true) |
Definition at line 2300 of file ImmersedBoundaryMesh.cpp.
Referenced by HeterotypicBoundaryLengthWriter< ELEMENT_DIM, SPACE_DIM >::Visit().
const std::vector< Node< SPACE_DIM > * > & ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::rGetNodes | ( | ) | const |
Definition at line 618 of file ImmersedBoundaryMesh.cpp.
Referenced by ImmersedBoundaryKinematicFeedbackForce< DIM >::UpdatePreviousLocations().
|
inlineprotected |
Archive the ImmersedBoundaryMesh and its member variables. Note that this will write out an ImmersedBoundaryMeshWriter file to wherever ArchiveLocationInfo has specified.
archive | the archive |
version | the current version of this class |
Definition at line 204 of file ImmersedBoundaryMesh.hpp.
References ArchiveLocationInfo::GetArchiveRelativePath(), ArchiveLocationInfo::GetMeshFilename(), and ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh().
double ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::ScaleDistanceDownFromVoronoi | ( | const double | distance | ) | const |
Helper method for voronoi functions. Scale a distance down from the voronoi coordinates.
distance | a distance in the voronoi diagram |
Definition at line 2291 of file ImmersedBoundaryMesh.cpp.
int ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::ScaleUpToVoronoiCoordinate | ( | double | location | ) | const |
Helper method for voronoi functions. Scale a location up to the integer grid needed by boost voronoi.
location | a location in [-mVoronoiHalo, 1.0 + mVoronoiHalo] |
Definition at line 2275 of file ImmersedBoundaryMesh.cpp.
void ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::SetCellRearrangementThreshold | ( | double | cellRearrangementThreshold | ) |
cellRearrangementThreshold | the new value of mCellRearrangementThreshold |
Definition at line 703 of file ImmersedBoundaryMesh.cpp.
void ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::SetCharacteristicNodeSpacing | ( | double | nodeSpacing | ) |
nodeSpacing | the new characteristic node spacing. |
Definition at line 658 of file ImmersedBoundaryMesh.cpp.
void ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::SetElementDivisionSpacing | ( | double | elementDivisionSpacing | ) |
elementDivisionSpacing | the new value of mElementDivisionSpacing |
Definition at line 1170 of file ImmersedBoundaryMesh.cpp.
Referenced by ImmersedBoundaryCellPopulation< DIM >::ImmersedBoundaryCellPopulation().
void ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::SetNeighbourDist | ( | double | neighbourDist | ) |
neighbourDist | the new value of mNeighbourDist |
Definition at line 786 of file ImmersedBoundaryMesh.cpp.
Referenced by ImmersedBoundaryCellPopulation< DIM >::ImmersedBoundaryCellPopulation().
void ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::SetNode | ( | unsigned | nodeIndex, |
ChastePoint< SPACE_DIM > | point | ||
) |
Move the node with a particular index to a new point in space.
nodeIndex | the index of the node to be moved |
point | the new target location of the node |
Definition at line 736 of file ImmersedBoundaryMesh.cpp.
void ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::SetNumGridPtsX | ( | unsigned | meshPointsX | ) |
meshPointsX | the new number of fluid mesh points in the x direction. |
Definition at line 636 of file ImmersedBoundaryMesh.cpp.
void ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::SetNumGridPtsXAndY | ( | unsigned | numGridPts | ) |
numGridPts | the new number of fluid mesh points in both directions. |
Definition at line 650 of file ImmersedBoundaryMesh.cpp.
void ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::SetNumGridPtsY | ( | unsigned | meshPointsY | ) |
meshPointsY | the new number of fluid mesh points in the x direction. |
Definition at line 643 of file ImmersedBoundaryMesh.cpp.
|
protected |
Solve boundary element mapping method. This overridden method is required as it is pure virtual in the base class.
index | the global index of the boundary element |
Definition at line 572 of file ImmersedBoundaryMesh.cpp.
|
protected |
Solve element mapping method. This overridden method is required as it is pure virtual in the base class.
index | the global index of the element |
Definition at line 565 of file ImmersedBoundaryMesh.cpp.
|
protectedvirtual |
Solve node mapping method. This overridden method is required as it is pure virtual in the base class.
index | the global index of the node |
Implements AbstractMesh< ELEMENT_DIM, SPACE_DIM >.
Definition at line 558 of file ImmersedBoundaryMesh.cpp.
|
protected |
Determine whether each element is on the boundary or not, and call the element's SetIsBoundaryElement() method.
It is not possible to define in precise terms whether an element is on the boundary (as there is no commonality of nodes as in a vertex population). Instead we use information from the node locations voronoi diagram. Any nodes with infinite voronoi edges are certainly in boundary elements, as well as nodes in elements whose voronoi cells are "too big".
Definition at line 2005 of file ImmersedBoundaryMesh.cpp.
References EXCEPTION, AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), and ImmersedBoundaryElement< ELEMENT_DIM, SPACE_DIM >::SetIsBoundaryElement().
void ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::UpdateNodeLocationsVoronoiDiagramIfOutOfDate | ( | ) |
Update mNodeLocationsVoronoiDiagram if it is out of date, which is the case when mSummaryOfNodeLocations is out-of-date, i.e. nodes have moved location. This ensures the update is performed at most once per time step.
Definition at line 2122 of file ImmersedBoundaryMesh.cpp.
References NEVER_REACHED.
Needed for serialization.
Definition at line 194 of file ImmersedBoundaryMesh.hpp.
Definition at line 71 of file ImmersedBoundaryMesh.hpp.
|
protected |
2D grid for fluid x velocity
Definition at line 110 of file ImmersedBoundaryMesh.hpp.
Referenced by ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::ImmersedBoundaryMesh().
|
protected |
3D grid for fluid x velocity
Definition at line 113 of file ImmersedBoundaryMesh.hpp.
|
protected |
Vector of fluid sources used to balance those of the elements.
Definition at line 125 of file ImmersedBoundaryMesh.hpp.
Referenced by ImmersedBoundaryMesh< DIM, DIM >::SolveNodeMapping().
|
protected |
The distance above which a cell vertex moving will trigger a step size exception
Definition at line 96 of file ImmersedBoundaryMesh.hpp.
|
protected |
Characteristic node spacing
Definition at line 81 of file ImmersedBoundaryMesh.hpp.
Referenced by ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::ImmersedBoundaryMesh().
|
protected |
Indices of elements that have been deleted. These indices can be reused when adding new elements.
Definition at line 107 of file ImmersedBoundaryMesh.hpp.
|
protected |
Indices of nodes that have been deleted. These indices can be reused when adding new elements/nodes.
Definition at line 104 of file ImmersedBoundaryMesh.hpp.
|
protected |
The required spacing when an element divides
Definition at line 84 of file ImmersedBoundaryMesh.hpp.
|
protected |
Vector of fluid sources related to elements.
Definition at line 122 of file ImmersedBoundaryMesh.hpp.
Referenced by ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::ImmersedBoundaryMesh().
|
protected |
Vector of pointers to ImmersedBoundaryElements.
Definition at line 116 of file ImmersedBoundaryMesh.hpp.
Referenced by ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::ImmersedBoundaryElementIterator::ImmersedBoundaryElementIterator(), and ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::ImmersedBoundaryMesh().
|
protected |
Vector of pointers to lamina ImmersedBoundaryElements.
Definition at line 119 of file ImmersedBoundaryMesh.hpp.
Referenced by ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::ImmersedBoundaryLaminaIterator::ImmersedBoundaryLaminaIterator(), ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::ImmersedBoundaryMesh(), ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetLaminaIteratorBegin(), and ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetLaminaIteratorEnd().
|
protected |
The distance at which two elements are neighbouring
Definition at line 87 of file ImmersedBoundaryMesh.hpp.
|
protected |
A voronoi diagram of the node locations, used to determine the element neighbours
Definition at line 128 of file ImmersedBoundaryMesh.hpp.
|
protected |
Number of grid points in x direction
Definition at line 75 of file ImmersedBoundaryMesh.hpp.
Referenced by ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::ImmersedBoundaryMesh().
|
protected |
Number of grid points in y direction
Definition at line 78 of file ImmersedBoundaryMesh.hpp.
Referenced by ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::ImmersedBoundaryMesh().
|
protected |
A summary statistic used by UpdateNodeLocationsVoronoiDiagramIfOutOfDate() to determine if mNodeLocationsVoronoiDiagram is out of date
Definition at line 93 of file ImmersedBoundaryMesh.hpp.
|
protected |
A vector keeping track voronoi cell IDs indexed by node index. This vector is the length of the largest node index, and is updated by UpdateNodeLocationsVoronoiDiagramIfOutOfDate().
The value mVoronoiCellIdsIndexedByNodeIndex[node_idx] gives the ID of the voronoi cell corresponding to the node with index node_idx.
Definition at line 137 of file ImmersedBoundaryMesh.hpp.
|
staticconstexprprotected |
A halo distance around the unit square, used when calculating the node voronoi diagram
Definition at line 101 of file ImmersedBoundaryMesh.hpp.