Chaste  Release::2017.1
StreeterFibreGenerator< SPACE_DIM > Class Template Reference

#include <StreeterFibreGenerator.hpp>

+ Inheritance diagram for StreeterFibreGenerator< SPACE_DIM >:
+ Collaboration diagram for StreeterFibreGenerator< SPACE_DIM >:

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)
 
- Public Member Functions inherited from AbstractPerElementWriter< SPACE_DIM, SPACE_DIM, SPACE_DIM *SPACE_DIM >
 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)
 
- Protected Member Functions inherited from AbstractPerElementWriter< SPACE_DIM, SPACE_DIM, SPACE_DIM *SPACE_DIM >
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< doublemWallThickness
 
std::vector< doublemAveragedWallThickness
 
bool mLogInfo
 

Additional Inherited Members

- Protected Attributes inherited from AbstractPerElementWriter< SPACE_DIM, SPACE_DIM, SPACE_DIM *SPACE_DIM >
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * mpMesh
 
out_stream mpMasterFile
 

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)
template<unsigned SPACE_DIM>
StreeterFibreGenerator< SPACE_DIM >::~StreeterFibreGenerator ( )

Destructor

Definition at line 163 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
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
nodeIndexThe index of the node in question
wallThicknessvector 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(), and AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes().

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

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

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

Parameters
nodesRegionsForElementis 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 111 of file StreeterFibreGenerator.cpp.

References NEVER_REACHED.

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

template<unsigned SPACE_DIM>
void StreeterFibreGenerator< SPACE_DIM >::PreWriteCalculations ( OutputFileHandler rOutputDirectory)
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

Parameters
rOutputDirectoryHandler 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, 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 ( const c_vector< double, SPACE_DIM > &  apexToBase)

Set the direction from apex to base

Parameters
apexToBaseis a non-zero vector. It will be stored in normalised form

Definition at line 447 of file StreeterFibreGenerator.cpp.

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

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

Set the direction from apex to base

Parameters
axisis the Cartesian axis from apex to base.

Definition at line 458 of file StreeterFibreGenerator.cpp.

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

template<unsigned SPACE_DIM>
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.

Parameters
logInfowhether or not to write log files.

Definition at line 469 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 
)

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
rEpicardiumFileEpicardium surface nodes (global indices).
rRightVentricleFileRight Ventricle surface nodes (global indices).
rLeftVentricleFileLeft Ventricle surface nodes (global indices).
indexFromZeroAre 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.

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

Associate an element with a fibre direction.

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

Parameters
pElementa locally-owned element for which to calculate or lookup some data
localElementIndexthe index of pElement in the local vector.
rDatathe 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 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, SmallPow(), and VectorProduct().

template<unsigned SPACE_DIM>
void StreeterFibreGenerator< SPACE_DIM >::WriteHeaderOnMaster ( )
protectedvirtual

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: