![]() |
Chaste Commit::333233612e3dcc941d260418acd7b5ccdc30390e
|
#include <StreeterFibreGenerator.hpp>
Public Member Functions | |
StreeterFibreGenerator (AbstractTetrahedralMesh< SPACE_DIM, SPACE_DIM > &rMesh) | |
~StreeterFibreGenerator () | |
void | SetSurfaceFiles (const std::string &rEpicardiumFile, const std::string &rRightVentricleFile, const std::string &rLeftVentricleFile, bool indexFromZero) |
void | SetApexToBase (const c_vector< double, SPACE_DIM > &apexToBase) |
void | SetApexToBase (unsigned axis) |
void | SetLogInfo (bool logInfo=true) |
![]() | |
AbstractPerElementWriter (AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh) | |
void | WriteData (OutputFileHandler &rHandler, const std::string &rFileName) |
void | SetWriteFileAsBinary (bool binary=true) |
virtual | ~AbstractPerElementWriter () |
Protected Member Functions | |
void | Visit (Element< SPACE_DIM, SPACE_DIM > *pElement, unsigned localElementIndex, c_vector< double, SPACE_DIM *SPACE_DIM > &rData) |
void | WriteHeaderOnMaster () |
void | PreWriteCalculations (OutputFileHandler &rOutputDirectory) |
![]() | |
virtual void | Visit (Element< ELEMENT_DIM, SPACE_DIM > *pElement, unsigned localElementIndex, c_vector< double, DATA_SIZE > &rData)=0 |
virtual void | WriteElementOnMaster (const c_vector< double, DATA_SIZE > &rData) |
Private Member Functions | |
double | GetAveragedThicknessLocalNode (const unsigned nodeIndex, const std::vector< double > &wallThickness) const |
double | GetFibreMaxAngle (const c_vector< HeartRegionType, SPACE_DIM+1 > &nodesRegionsForElement) const |
Private Attributes | |
HeartGeometryInformation< SPACE_DIM > * | mpGeometryInfo |
c_vector< double, SPACE_DIM > | mApexToBase |
std::vector< double > | mWallThickness |
std::vector< double > | mAveragedWallThickness |
bool | mLogInfo |
Additional Inherited Members | |
![]() | |
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * | mpMesh |
out_stream | mpMasterFile |
Generate fibre in a ventricular mesh using the description in Streeter DD, Jr, Spotnitz HM, Patel DP, Ross J, Jr, Sonnenblick EH. Fiber orientation in the canine left ventricle during diastole and systole. Circ Res. 1969 Mar;24(3):339–347.
Formulae used to generate the fibre orientations are in A Comparison of Monodomain and Bidomain Reaction-Diffusion Models for Action Potential Propagation in the Human Heart Mark Potse, Bruno Dubé, Jacques Richer, Alain Vinet, and Ramesh M. Gulrajani IEEE Trans. Biomed. Eng. 53(12):2425-2435, 2006.
Output file format: The first line indicates the number of elements. Each of the following lines contain SPACE_DIM vectors of SPACE_DIM elements for the direction of the myofibre, the transverse to it in the plane of the myocyte laminae and the normal to this laminae.
Definition at line 64 of file StreeterFibreGenerator.hpp.
StreeterFibreGenerator< SPACE_DIM >::StreeterFibreGenerator | ( | AbstractTetrahedralMesh< SPACE_DIM, SPACE_DIM > & | rMesh | ) |
Constructor
rMesh | Reference to the tetrahedral mesh of the ventricles. |
Definition at line 149 of file StreeterFibreGenerator.cpp.
References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), StreeterFibreGenerator< SPACE_DIM >::mAveragedWallThickness, StreeterFibreGenerator< SPACE_DIM >::mWallThickness, and Citations::Register().
StreeterFibreGenerator< SPACE_DIM >::~StreeterFibreGenerator | ( | ) |
Destructor
Definition at line 163 of file StreeterFibreGenerator.cpp.
|
private |
Compute the wall thickness of a given node based on a neighbourhood average of its thickness and of those in the forward star.
nodeIndex | The index of the node in question |
wallThickness | vector of thickness of all nodes in node index order |
Definition at line 62 of file StreeterFibreGenerator.cpp.
References Node< SPACE_DIM >::ContainingElementsBegin(), Node< SPACE_DIM >::ContainingElementsEnd(), Node< SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), and AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes().
|
private |
R is the maximum angle between the fibre and the v axis (heart region dependant)
nodesRegionsForElement | is a small vector containing the region tags of the element's nodes |
Definition at line 111 of file StreeterFibreGenerator.cpp.
References NEVER_REACHED.
|
protectedvirtual |
Does calculations to generate an orthotropic fibre orientation model of the ventricular mesh provided. In particular - populates the member variables mWallThickness and mAveragedWallThickness.
Also writes these to file if SetLogInfo() has been called.
Assumes that the base-apex axis is x. Based on Streeter 1969 and Potse 2006
rOutputDirectory | Handler for output directory |
Reimplemented from AbstractPerElementWriter< SPACE_DIM, SPACE_DIM, SPACE_DIM *SPACE_DIM >.
Definition at line 187 of file StreeterFibreGenerator.cpp.
References PetscTools::AmMaster(), EXCEPTION, NEVER_REACHED, OutputFileHandler::OpenOutputFile(), and HeartGeometryInformation< SPACE_DIM >::rGetDistanceMapEpicardium().
void StreeterFibreGenerator< SPACE_DIM >::SetApexToBase | ( | const c_vector< double, SPACE_DIM > & | apexToBase | ) |
Set the direction from apex to base
apexToBase | is a non-zero vector. It will be stored in normalised form |
Definition at line 447 of file StreeterFibreGenerator.cpp.
References EXCEPTION.
void StreeterFibreGenerator< SPACE_DIM >::SetApexToBase | ( | unsigned | axis | ) |
Set the direction from apex to base
axis | is the Cartesian axis from apex to base. |
Definition at line 458 of file StreeterFibreGenerator.cpp.
References EXCEPTION.
void StreeterFibreGenerator< SPACE_DIM >::SetLogInfo | ( | bool | logInfo = true | ) |
Tells the WriteData method to output extra debug info on nodes in particular regions, and wall thicknesses.
logInfo | whether or not to write log files. |
Definition at line 469 of file StreeterFibreGenerator.cpp.
void StreeterFibreGenerator< SPACE_DIM >::SetSurfaceFiles | ( | const std::string & | rEpicardiumFile, |
const std::string & | rRightVentricleFile, | ||
const std::string & | rLeftVentricleFile, | ||
bool | indexFromZero | ||
) |
Uses the names of files defining the different surfaces of the mesh to construct the geometry information class File formats: list of nodes, either one per line or multiple (e.g. nodes in each boundary element on surface).
rEpicardiumFile | Epicardium surface nodes (global indices). |
rRightVentricleFile | Right Ventricle surface nodes (global indices). |
rLeftVentricleFile | Left Ventricle surface nodes (global indices). |
indexFromZero | Are the nodes in the original mesh file/surface files indexed from 0? |
If either rRightVentricleFile or rLeftVentricleFile are the empty string, then it is assumed that this is a wedge preparation for left or right ventricle, respectively. That is, the ventricle with a non-empty string. If both are empty strings then throws exception in HeartGeometryInformation.
Definition at line 169 of file StreeterFibreGenerator.cpp.
|
protected |
Associate an element with a fibre direction.
This is only called (by abstract class) on processes which own pElement.
pElement | a locally-owned element for which to calculate or lookup some data |
localElementIndex | the index of pElement in the local vector. |
rData | the double-precision data to write to file (output from the method). Gives Fibre x 3 (space dim), sheet(3), normal(3) in one vector. |
Definition at line 314 of file StreeterFibreGenerator.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), and VectorProduct().
|
protectedvirtual |
Overridden method to write the header line.
Reimplemented from AbstractPerElementWriter< SPACE_DIM, SPACE_DIM, SPACE_DIM *SPACE_DIM >.
Definition at line 180 of file StreeterFibreGenerator.cpp.
|
private |
Normalised direction from apex to base
Definition at line 69 of file StreeterFibreGenerator.hpp.
|
private |
Wall thickness at each node, smoothed by averaging over local nodes by GetAveragedThicknessLocalNode().
Definition at line 93 of file StreeterFibreGenerator.hpp.
Referenced by StreeterFibreGenerator< SPACE_DIM >::StreeterFibreGenerator().
|
private |
Whether to write Streeter generation log files for regions and wall thicknesses
Definition at line 96 of file StreeterFibreGenerator.hpp.
|
private |
Provides a method to calculate the relative position of a node with respect to two (or three) given surfaces
Definition at line 67 of file StreeterFibreGenerator.hpp.
|
private |
Wall thickness at each node in the mesh.
Definition at line 90 of file StreeterFibreGenerator.hpp.
Referenced by StreeterFibreGenerator< SPACE_DIM >::StreeterFibreGenerator().