StreeterFibreGenerator< SPACE_DIM > Class Template Reference

#include <StreeterFibreGenerator.hpp>

Inherits AbstractPerElementWriter< SPACE_DIM, SPACE_DIM, SPACE_DIM *SPACE_DIM >.

Collaboration diagram for StreeterFibreGenerator< SPACE_DIM >:
Collaboration graph
[legend]

List of all members.

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)

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)

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< doublemWallThickness
std::vector< doublemAveragedWallThickness
bool mLogInfo

Detailed Description

template<unsigned SPACE_DIM>
class StreeterFibreGenerator< SPACE_DIM >

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.


Constructor & Destructor Documentation

template<unsigned SPACE_DIM>
StreeterFibreGenerator< SPACE_DIM >::StreeterFibreGenerator ( AbstractTetrahedralMesh< SPACE_DIM, SPACE_DIM > &  rMesh  )  [inline]
template<unsigned SPACE_DIM>
StreeterFibreGenerator< SPACE_DIM >::~StreeterFibreGenerator (  )  [inline]

Destructor

Definition at line 166 of file StreeterFibreGenerator.cpp.

References StreeterFibreGenerator< SPACE_DIM >::mpGeometryInfo.


Member Function Documentation

template<unsigned SPACE_DIM>
double StreeterFibreGenerator< SPACE_DIM >::GetAveragedThicknessLocalNode ( const unsigned  nodeIndex,
const std::vector< double > &  wallThickness 
) const [inline, private]

Compute the wall thickness of a given node based on a neighbourhood average of its thickness and of those in the forward star.

Parameters:
nodeIndex The index of the node in question
wallThickness vector of thickness of all nodes in node index order
Returns:
Neighbourhood average thickness (will return 0 if the node is not local to this process)

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(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and AbstractPerElementWriter< SPACE_DIM, SPACE_DIM, SPACE_DIM *SPACE_DIM >::mpMesh.

Referenced by StreeterFibreGenerator< SPACE_DIM >::PreWriteCalculations().

template<unsigned SPACE_DIM>
double StreeterFibreGenerator< SPACE_DIM >::GetFibreMaxAngle ( const c_vector< HeartRegionType, SPACE_DIM+1 > &  nodesRegionsForElement  )  const [inline, private]

R is the maximum angle between the fibre and the v axis (heart region dependant)

Parameters:
nodesRegionsForElement is a small vector containing the region tags of the element's nodes
Returns:
Pi/4 (if the element is in RV), Pi/3 otherwise

Definition at line 114 of file StreeterFibreGenerator.cpp.

References NEVER_REACHED.

Referenced by StreeterFibreGenerator< SPACE_DIM >::Visit().

template<unsigned SPACE_DIM>
void StreeterFibreGenerator< SPACE_DIM >::PreWriteCalculations ( OutputFileHandler rOutputDirectory  )  [inline, protected, virtual]

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

Parameters:
rOutputDirectory Handler for output directory

Reimplemented from AbstractPerElementWriter< SPACE_DIM, SPACE_DIM, SPACE_DIM *SPACE_DIM >.

Definition at line 190 of file StreeterFibreGenerator.cpp.

References PetscTools::AmMaster(), EXCEPTION, StreeterFibreGenerator< SPACE_DIM >::GetAveragedThicknessLocalNode(), StreeterFibreGenerator< SPACE_DIM >::mApexToBase, StreeterFibreGenerator< SPACE_DIM >::mAveragedWallThickness, StreeterFibreGenerator< SPACE_DIM >::mLogInfo, StreeterFibreGenerator< SPACE_DIM >::mpGeometryInfo, AbstractPerElementWriter< SPACE_DIM, SPACE_DIM, SPACE_DIM *SPACE_DIM >::mpMesh, StreeterFibreGenerator< SPACE_DIM >::mWallThickness, NEVER_REACHED, and OutputFileHandler::OpenOutputFile().

template<unsigned SPACE_DIM>
void StreeterFibreGenerator< SPACE_DIM >::SetApexToBase ( unsigned  axis  )  [inline]

Set the direction from apex to base

Parameters:
axis is the Cartesian axis from apex to base.

Definition at line 462 of file StreeterFibreGenerator.cpp.

References EXCEPTION, and StreeterFibreGenerator< SPACE_DIM >::mApexToBase.

template<unsigned SPACE_DIM>
void StreeterFibreGenerator< SPACE_DIM >::SetApexToBase ( const c_vector< double, SPACE_DIM > &  apexToBase  )  [inline]

Set the direction from apex to base

Parameters:
apexToBase is a non-zero vector. It will be stored in normalised form

Definition at line 451 of file StreeterFibreGenerator.cpp.

References EXCEPTION, and StreeterFibreGenerator< SPACE_DIM >::mApexToBase.

template<unsigned SPACE_DIM>
void StreeterFibreGenerator< SPACE_DIM >::SetLogInfo ( bool  logInfo = true  )  [inline]

Tells the WriteData method to output extra debug info on nodes in particular regions, and wall thicknesses.

Parameters:
logInfo whether or not to write log files.

Definition at line 473 of file StreeterFibreGenerator.cpp.

References StreeterFibreGenerator< SPACE_DIM >::mLogInfo.

template<unsigned SPACE_DIM>
void StreeterFibreGenerator< SPACE_DIM >::SetSurfaceFiles ( const std::string &  rEpicardiumFile,
const std::string &  rRightVentricleFile,
const std::string &  rLeftVentricleFile,
bool  indexFromZero 
) [inline]

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).

Parameters:
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 172 of file StreeterFibreGenerator.cpp.

References StreeterFibreGenerator< SPACE_DIM >::mpGeometryInfo, and AbstractPerElementWriter< SPACE_DIM, SPACE_DIM, SPACE_DIM *SPACE_DIM >::mpMesh.

template<unsigned SPACE_DIM>
void StreeterFibreGenerator< SPACE_DIM >::Visit ( Element< SPACE_DIM, SPACE_DIM > *  pElement,
unsigned  localElementIndex,
c_vector< double, SPACE_DIM *SPACE_DIM > &  rData 
) [inline, protected]

Associate an element with a fibre direction.

This is only called (by abstract class) on processes which own pElement.

Parameters:
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 317 of file StreeterFibreGenerator.cpp.

References StreeterFibreGenerator< SPACE_DIM >::GetFibreMaxAngle(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), StreeterFibreGenerator< SPACE_DIM >::mApexToBase, StreeterFibreGenerator< SPACE_DIM >::mAveragedWallThickness, StreeterFibreGenerator< SPACE_DIM >::mpGeometryInfo, AbstractPerElementWriter< SPACE_DIM, SPACE_DIM, SPACE_DIM *SPACE_DIM >::mpMesh, StreeterFibreGenerator< SPACE_DIM >::mWallThickness, and VectorProduct().

template<unsigned SPACE_DIM>
void StreeterFibreGenerator< SPACE_DIM >::WriteHeaderOnMaster (  )  [inline, protected, virtual]

Member Data Documentation

template<unsigned SPACE_DIM>
c_vector<double, SPACE_DIM> StreeterFibreGenerator< SPACE_DIM >::mApexToBase [private]
template<unsigned SPACE_DIM>
std::vector<double> StreeterFibreGenerator< SPACE_DIM >::mAveragedWallThickness [private]
template<unsigned SPACE_DIM>
bool StreeterFibreGenerator< SPACE_DIM >::mLogInfo [private]

Whether to write Streeter generation log files for regions and wall thicknesses

Definition at line 96 of file StreeterFibreGenerator.hpp.

Referenced by StreeterFibreGenerator< SPACE_DIM >::PreWriteCalculations(), and StreeterFibreGenerator< SPACE_DIM >::SetLogInfo().

template<unsigned SPACE_DIM>
HeartGeometryInformation<SPACE_DIM>* StreeterFibreGenerator< SPACE_DIM >::mpGeometryInfo [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.

Referenced by StreeterFibreGenerator< SPACE_DIM >::PreWriteCalculations(), StreeterFibreGenerator< SPACE_DIM >::SetSurfaceFiles(), StreeterFibreGenerator< SPACE_DIM >::Visit(), and StreeterFibreGenerator< SPACE_DIM >::~StreeterFibreGenerator().

template<unsigned SPACE_DIM>
std::vector<double> StreeterFibreGenerator< SPACE_DIM >::mWallThickness [private]

The documentation for this class was generated from the following files:

Generated by  doxygen 1.6.2