Chaste Commit::1fd4e48e3990e67db148bc1bc4cf6991a0049d0c
|
#include <ImmersedBoundaryMeshWriter.hpp>
Public Member Functions | |
ImmersedBoundaryMeshWriter (const std::string &rDirectory, const std::string &rBaseName, bool clearOutputDir=true) | |
~ImmersedBoundaryMeshWriter () | |
void | WriteFilesUsingMesh (ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM > &rMesh) |
void | WriteVtkUsingMesh (ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM > &rMesh, std::string stamp="") |
void | MakeVtkMesh (ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM > &rMesh) |
void | AddCellData (std::string dataName, std::vector< double > dataPayload) |
void | AddPointData (std::string dataName, std::vector< double > dataPayload) |
std::vector< double > | GetNextNode () |
ImmersedBoundaryElementData | GetNextImmersedBoundaryElement () |
ImmersedBoundaryElementData | GetNextImmersedBoundaryLamina () |
void | WriteFiles () |
void | FindElementOverlaps (ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM > &rMesh) |
const std::vector< std::vector< unsigned > > & | rGetElementParts () const |
void | MakeVtkMesh (ImmersedBoundaryMesh< 1, 1 > &rMesh) |
Public Member Functions inherited from AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM > | |
AbstractMeshWriter (const std::string &rDirectory, const std::string &rBaseName, const bool clearOutputDir=true) | |
virtual | ~AbstractMeshWriter () |
std::string | GetOutputDirectory () |
virtual unsigned | GetNumNodes () |
unsigned | GetNumElements () |
unsigned | GetNumBoundaryFaces () |
unsigned | GetNumCableElements () |
virtual ElementData | GetNextElement () |
virtual ElementData | GetNextBoundaryElement () |
virtual ElementData | GetNextCableElement () |
void | WriteFilesUsingMeshReader (AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader) |
Private Types | |
using | geom_point = boost::geometry::model::point< double, 2, boost::geometry::cs::cartesian > |
using | geom_segment = boost::geometry::model::segment< geom_point > |
Private Member Functions | |
c_vector< double, SPACE_DIM > | GetIntersectionOfEdgeWithBoundary (const c_vector< double, SPACE_DIM > &rStart, const c_vector< double, SPACE_DIM > &rEnd) |
c_vector< double, SPACE_DIM > | GetNearestCorner (const c_vector< double, SPACE_DIM > &rA, const c_vector< double, SPACE_DIM > &rB) const |
Private Attributes | |
ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM > * | mpMesh |
MeshWriterIterators< ELEMENT_DIM, SPACE_DIM > * | mpIters |
unsigned | mNumLaminas |
std::vector< std::vector< unsigned > > | mElementParts |
std::array< geom_segment, 4 > | mBoundaryEdges |
vtkUnstructuredGrid * | mpVtkUnstructedMesh |
Additional Inherited Members | |
Protected Attributes inherited from AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM > | |
OutputFileHandler * | mpOutputFileHandler |
std::string | mBaseName |
AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > * | mpMeshReader |
unsigned | mNumNodes |
unsigned | mNumElements |
unsigned | mNumBoundaryElements |
unsigned | mNumCableElements |
A mesh writer class for immersed boundary meshes.
Definition at line 76 of file ImmersedBoundaryMeshWriter.hpp.
|
private |
Shorthand for a 2d cartesian point
Definition at line 96 of file ImmersedBoundaryMeshWriter.hpp.
|
private |
Shorthand for a segment of geom_points
Definition at line 99 of file ImmersedBoundaryMeshWriter.hpp.
ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::ImmersedBoundaryMeshWriter | ( | const std::string & | rDirectory, |
const std::string & | rBaseName, | ||
bool | clearOutputDir = true |
||
) |
Constructor.
rDirectory | reference to the output directory, relative to where Chaste output is stored |
rBaseName | reference to the base name for results files |
clearOutputDir | whether to clear the output directory prior to writing files (defaults to true) |
Definition at line 62 of file ImmersedBoundaryMeshWriter.cpp.
References ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::mBoundaryEdges, ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpIters, ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpVtkUnstructedMesh, and NEVER_REACHED.
ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::~ImmersedBoundaryMeshWriter | ( | ) |
Destructor.
Definition at line 101 of file ImmersedBoundaryMeshWriter.cpp.
void ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::AddCellData | ( | std::string | dataName, |
std::vector< double > | dataPayload | ||
) |
Add data to a future VTK file.
dataName | a tag to go into the VTK file |
dataPayload | a pay-load of length (number of elements) |
Definition at line 482 of file ImmersedBoundaryMeshWriter.cpp.
Referenced by ImmersedBoundaryCellPopulation< DIM >::WriteVtkResultsToFile().
void ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::AddPointData | ( | std::string | dataName, |
std::vector< double > | dataPayload | ||
) |
Add data to a future VTK file.
dataName | a tag to go into the VTK file |
dataPayload | a pay-load of length (number of nodes) |
Definition at line 499 of file ImmersedBoundaryMeshWriter.cpp.
Referenced by ImmersedBoundaryCellPopulation< DIM >::WriteVtkResultsToFile().
void ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::FindElementOverlaps | ( | ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM > & | rMesh | ) |
Analyses the mesh to determine where (if at all) each element overlaps due to the periodic boundaries.
rMesh | the immersed boundary mesh |
Definition at line 733 of file ImmersedBoundaryMeshWriter.cpp.
References ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin(), ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorEnd(), ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetNumAllElements(), and NEVER_REACHED.
Referenced by ImmersedBoundaryCellPopulation< DIM >::WriteVtkResultsToFile().
|
private |
When elements cross the periodic boundary they are broken up into pieces for visualisation. Some additional points are needed where the element edge crosses the boundary to produce good output polygons.
This function returns the location on the boundary where an edge (given by rStart and rEnd) crosses d[0,1]x[0,1].
rStart | the start point of the edge that crosses the boundary |
rEnd | the end point of the edge that crosses the boundary |
Definition at line 768 of file ImmersedBoundaryMeshWriter.cpp.
References NEVER_REACHED.
|
private |
Helper function to get the nearest corner to the average of two points on the boundary.
rA | one of the boundary points |
rB | the other boundary point |
Definition at line 800 of file ImmersedBoundaryMeshWriter.cpp.
ImmersedBoundaryElementData ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextImmersedBoundaryElement | ( | ) |
Definition at line 146 of file ImmersedBoundaryMeshWriter.cpp.
References ImmersedBoundaryElementData::AttributeValue, ImmersedBoundaryElementData::averageNodeSpacing, ImmersedBoundaryElementData::cornerNodeIndices, EXCEPTION, ImmersedBoundaryElementData::fluidSourceIndex, ImmersedBoundaryElementData::hasFluidSource, ImmersedBoundaryElementData::isBoundaryElement, and ImmersedBoundaryElementData::NodeIndices.
ImmersedBoundaryElementData ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextImmersedBoundaryLamina | ( | ) |
Definition at line 191 of file ImmersedBoundaryMeshWriter.cpp.
References ImmersedBoundaryElementData::AttributeValue, ImmersedBoundaryElementData::averageNodeSpacing, ImmersedBoundaryElementData::cornerNodeIndices, EXCEPTION, ImmersedBoundaryElementData::fluidSourceIndex, ImmersedBoundaryElementData::hasFluidSource, ImmersedBoundaryElementData::isBoundaryElement, and ImmersedBoundaryElementData::NodeIndices.
|
virtual |
Reimplemented from AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >.
Definition at line 119 of file ImmersedBoundaryMeshWriter.cpp.
References AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextNode().
void ImmersedBoundaryMeshWriter< 1, 1 >::MakeVtkMesh | ( | ImmersedBoundaryMesh< 1, 1 > & | rMesh | ) |
Template instnantiation for unused code path
rMesh | the mesh |
Definition at line 476 of file ImmersedBoundaryMeshWriter.cpp.
void ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::MakeVtkMesh | ( | ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM > & | rMesh | ) |
Populate mpVtkUnstructedMesh using a vertex-based mesh. Called by WriteVtkUsingMesh().
rMesh | reference to the vertex-based mesh |
To allow viewing in Paraview, we have to treat differently cells which overlap the boundaries, as there is no support for periodicity in Paraview.
We overcome this by first identifying which cells overlap, and breaking them in to pieces as necessary, so that each cell when displayed stays contiguous.
Cell overlaps should have already been calculated - this is done by a call to FindElementOverlaps() from ImmersedBoundaryCellPopulation::WriteVtkResultsToFile().
Because no node can be present in more than one cell, it is safe to add points to mpVtkUnstructuredMesh as we go through each cell, rather than having to add nodes before cells.
Definition at line 282 of file ImmersedBoundaryMeshWriter.cpp.
References ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin(), ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorEnd(), Node< SPACE_DIM >::GetIndex(), ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetLaminaIteratorBegin(), ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetLaminaIteratorEnd(), ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetVectorFromAtoB(), NEVER_REACHED, and Node< SPACE_DIM >::rGetLocation().
const std::vector< std::vector< unsigned > > & ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::rGetElementParts | ( | ) | const |
Definition at line 811 of file ImmersedBoundaryMeshWriter.cpp.
Referenced by ImmersedBoundaryCellPopulation< DIM >::WriteVtkResultsToFile().
|
virtual |
Write mesh data to files. This method must be overridden in concrete classes.
Implements AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >.
Definition at line 538 of file ImmersedBoundaryMeshWriter.cpp.
References ImmersedBoundaryElementData::AttributeValue, ImmersedBoundaryElementData::averageNodeSpacing, ImmersedBoundaryElementData::cornerNodeIndices, ImmersedBoundaryElementData::fluidSourceIndex, ChasteBuildInfo::GetProvenanceString(), ImmersedBoundaryElementData::hasFluidSource, ImmersedBoundaryElementData::isBoundaryElement, and ImmersedBoundaryElementData::NodeIndices.
void ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh | ( | ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM > & | rMesh | ) |
Write files using a mesh.
rMesh | reference to the vertex-based mesh |
Definition at line 516 of file ImmersedBoundaryMeshWriter.cpp.
References ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes().
Referenced by ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM >::save().
void ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteVtkUsingMesh | ( | ImmersedBoundaryMesh< ELEMENT_DIM, SPACE_DIM > & | rMesh, |
std::string | stamp = "" |
||
) |
Write VTK file using a mesh.
rMesh | reference to the immersed boundary mesh |
stamp | is an optional stamp (like a time-stamp) to put into the name of the file |
Definition at line 243 of file ImmersedBoundaryMeshWriter.cpp.
References NEVER_REACHED.
Referenced by ImmersedBoundaryCellPopulation< DIM >::WriteVtkResultsToFile().
|
private |
Array of geom_segments; a helper array, filled by the constructor, for GetIntersectionOfEdgeWithBoundary
Definition at line 102 of file ImmersedBoundaryMeshWriter.hpp.
Referenced by ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::ImmersedBoundaryMeshWriter().
|
private |
Vector containing, for each element, the node indices at which it must be split for visualisation
Definition at line 92 of file ImmersedBoundaryMeshWriter.hpp.
|
private |
The number of laminas in the mesh
Definition at line 89 of file ImmersedBoundaryMeshWriter.hpp.
|
private |
Iterators over the mesh
Definition at line 86 of file ImmersedBoundaryMeshWriter.hpp.
Referenced by ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::ImmersedBoundaryMeshWriter().
|
private |
If writing from a mesh object, the mesh to write to disk. Otherwise NULL.
Definition at line 83 of file ImmersedBoundaryMeshWriter.hpp.
|
private |
Definition at line 129 of file ImmersedBoundaryMeshWriter.hpp.
Referenced by ImmersedBoundaryMeshWriter< ELEMENT_DIM, SPACE_DIM >::ImmersedBoundaryMeshWriter().