AbstractCardiacMechanicsAssembler< DIM > Class Template Reference

#include <AbstractCardiacMechanicsAssembler.hpp>

Inherits NonlinearElasticityAssembler< DIM >.

Inherited by ExplicitCardiacMechanicsAssembler< DIM >, and ImplicitCardiacMechanicsAssembler< DIM >.

Collaboration diagram for AbstractCardiacMechanicsAssembler< DIM >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 AbstractCardiacMechanicsAssembler (QuadraticMesh< DIM > *pQuadMesh, std::string outputDirectory, std::vector< unsigned > &rFixedNodes, AbstractIncompressibleMaterialLaw< DIM > *pMaterialLaw)
 ~AbstractCardiacMechanicsAssembler ()
unsigned GetTotalNumQuadPoints ()
virtual GaussianQuadratureRule
< DIM > * 
GetQuadratureRule ()
void SetConstantFibreSheetDirections (const c_matrix< double, DIM, DIM > &rFibreSheetMatrix)
void SetVariableFibreSheetDirections (std::string orthoFile)
void SetCalciumAndVoltage (std::vector< double > &rCalciumConcentrations, std::vector< double > &rVoltages)
virtual void Solve (double time, double nextTime, double odeTimestep)=0

Protected Member Functions

void CheckOrthogonality (c_matrix< double, DIM, DIM > &rMatrix)
virtual bool IsImplicitSolver ()=0
void AssembleOnElement (Element< DIM, DIM > &rElement, c_matrix< double, STENCIL_SIZE, STENCIL_SIZE > &rAElem, c_matrix< double, STENCIL_SIZE, STENCIL_SIZE > &rAElemPrecond, c_vector< double, STENCIL_SIZE > &rBElem, bool assembleResidual, bool assembleJacobian)
virtual void GetActiveTensionAndTensionDerivs (double currentFibreStretch, unsigned currentQuadPointGlobalIndex, bool assembleJacobian, double &rActiveTension, double &rDerivActiveTensionWrtLambda, double &rDerivActiveTensionWrtDLambdaDt)=0

Protected Attributes

std::vector
< AbstractContractionModel * > 
mContractionModelSystems
std::vector< doublemStretches
unsigned mTotalQuadPoints
bool mAllocatedMaterialLawMemory
double mCurrentTime
double mNextTime
double mOdeTimestep
c_matrix< double, DIM, DIM > mConstantFibreSheetDirections
std::vector< c_matrix< double,
DIM, DIM > > * 
mpVariableFibreSheetDirections

Static Protected Attributes

static const unsigned STENCIL_SIZE = NonlinearElasticityAssembler<DIM>::STENCIL_SIZE
static const unsigned NUM_NODES_PER_ELEMENT = NonlinearElasticityAssembler<DIM>::NUM_NODES_PER_ELEMENT
static const unsigned NUM_VERTICES_PER_ELEMENT = NonlinearElasticityAssembler<DIM>::NUM_VERTICES_PER_ELEMENT

Detailed Description

template<unsigned DIM>
class AbstractCardiacMechanicsAssembler< DIM >

AbstractCardiacMechanicsAssembler

Base class to implicit and explicit cardiac mechanics assemblers. Inherits from NonlinearElasticityAssembler Main method is the overloaded AssembleOnElement which does the extra work needed for cardiac problems. The child classes hold the contraction models and need to implement a method for getting the active tension from the model.

Definition at line 47 of file AbstractCardiacMechanicsAssembler.hpp.


Constructor & Destructor Documentation

template<unsigned DIM>
AbstractCardiacMechanicsAssembler< DIM >::AbstractCardiacMechanicsAssembler ( QuadraticMesh< DIM > *  pQuadMesh,
std::string  outputDirectory,
std::vector< unsigned > &  rFixedNodes,
AbstractIncompressibleMaterialLaw< DIM > *  pMaterialLaw 
) [inline]
template<unsigned DIM>
AbstractCardiacMechanicsAssembler< DIM >::~AbstractCardiacMechanicsAssembler (  )  [inline]

Member Function Documentation

template<unsigned DIM>
void AbstractCardiacMechanicsAssembler< DIM >::AssembleOnElement ( Element< DIM, DIM > &  rElement,
c_matrix< double, STENCIL_SIZE, STENCIL_SIZE > &  rAElem,
c_matrix< double, STENCIL_SIZE, STENCIL_SIZE > &  rAElemPrecond,
c_vector< double, STENCIL_SIZE > &  rBElem,
bool  assembleResidual,
bool  assembleJacobian 
) [inline, protected, virtual]

Overloaded AssembleOnElement. Apart from a tiny bit of initial set up and the lack of the body force term in the residual, the bits where this is different to the base class AssembleOnElement are restricted to two bits (see code): getting Ta and using it to compute the stress, and (in when Ta is a function of the stretch) the addition of extra term to the Jacobian.

Parameters:
rElement The element to assemble on.
rAElem The element's contribution to the LHS matrix is returned in this n by n matrix, where n is the no. of nodes in this element. There is no need to zero this matrix before calling.
rAElemPrecond The element's contribution to the matrix passed to PetSC in creating a preconditioner
rBElem The element's contribution to the RHS vector is returned in this vector of length n, the no. of nodes in this element. There is no need to zero this vector before calling.
assembleResidual A bool stating whether to assemble the residual vector.
assembleJacobian A bool stating whether to assemble the Jacobian matrix.

Reimplemented from NonlinearElasticityAssembler< DIM >.

Definition at line 312 of file AbstractCardiacMechanicsAssembler.hpp.

References AbstractIncompressibleMaterialLaw< DIM >::ComputeStressAndStressDerivative(), AbstractNonlinearElasticityAssembler< DIM >::dTdE, AbstractCardiacMechanicsAssembler< DIM >::GetActiveTensionAndTensionDerivs(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), GaussianQuadratureRule< ELEMENT_DIM >::GetNumQuadPoints(), GaussianQuadratureRule< ELEMENT_DIM >::GetWeight(), AbstractCardiacMechanicsAssembler< DIM >::IsImplicitSolver(), AbstractCardiacMechanicsAssembler< DIM >::mConstantFibreSheetDirections, AbstractNonlinearElasticityAssembler< DIM >::mCurrentSolution, AbstractCardiacMechanicsAssembler< DIM >::mCurrentTime, AbstractNonlinearElasticityAssembler< DIM >::mMaterialLaws, AbstractCardiacMechanicsAssembler< DIM >::mNextTime, AbstractCardiacMechanicsAssembler< DIM >::mOdeTimestep, NonlinearElasticityAssembler< DIM >::mpQuadMesh, NonlinearElasticityAssembler< DIM >::mpQuadratureRule, AbstractCardiacMechanicsAssembler< DIM >::mpVariableFibreSheetDirections, AbstractCardiacMechanicsAssembler< DIM >::NUM_NODES_PER_ELEMENT, AbstractCardiacMechanicsAssembler< DIM >::NUM_VERTICES_PER_ELEMENT, GaussianQuadratureRule< ELEMENT_DIM >::rGetQuadPoint(), FourthOrderTensor< DIM >::SetAsProduct(), AbstractIncompressibleMaterialLaw< DIM >::SetChangeOfBasisMatrix(), and AbstractCardiacMechanicsAssembler< DIM >::STENCIL_SIZE.

template<unsigned DIM>
void AbstractCardiacMechanicsAssembler< DIM >::CheckOrthogonality ( c_matrix< double, DIM, DIM > &  rMatrix  )  [inline, protected]

Check whether the given matrix is orthogonal, by computing A^T A and verifying whether each component matches the identity matrix, to a given tolerance.

Parameters:
rMatrix reference to the matrix being tested

Definition at line 94 of file AbstractCardiacMechanicsAssembler.hpp.

Referenced by AbstractCardiacMechanicsAssembler< DIM >::SetConstantFibreSheetDirections(), and AbstractCardiacMechanicsAssembler< DIM >::SetVariableFibreSheetDirections().

template<unsigned DIM>
virtual void AbstractCardiacMechanicsAssembler< DIM >::GetActiveTensionAndTensionDerivs ( double  currentFibreStretch,
unsigned  currentQuadPointGlobalIndex,
bool  assembleJacobian,
double rActiveTension,
double rDerivActiveTensionWrtLambda,
double rDerivActiveTensionWrtDLambdaDt 
) [protected, pure virtual]

Pure method called in AbstractCardiacMechanicsAssembler::AssembleOnElement(), which needs to provide the active tension (and other info if implicit (if the contraction model depends on stretch or stretch rate)) at a particular quadrature point. Takes in the current fibre stretch.

Parameters:
currentFibreStretch The stretch in the fibre direction
currentQuadPointGlobalIndex quadrature point integrand currently being evaluated at in AssembleOnElement
assembleJacobian A bool stating whether to assemble the Jacobian matrix.
rActiveTension The returned active tension
rDerivActiveTensionWrtLambda The returned dT_dLam, derivative of active tension wrt stretch. Only should be set in implicit assemblers
rDerivActiveTensionWrtDLambdaDt The returned dT_dLamDot, derivative of active tension wrt stretch rate. Only should be set in implicit assemblers

Implemented in ExplicitCardiacMechanicsAssembler< DIM >, and ImplicitCardiacMechanicsAssembler< DIM >.

Referenced by AbstractCardiacMechanicsAssembler< DIM >::AssembleOnElement().

template<unsigned DIM>
virtual GaussianQuadratureRule<DIM>* AbstractCardiacMechanicsAssembler< DIM >::GetQuadratureRule (  )  [inline, virtual]

Get the quadrature rule used in the elements.

Definition at line 236 of file AbstractCardiacMechanicsAssembler.hpp.

References NonlinearElasticityAssembler< DIM >::mpQuadratureRule.

template<unsigned DIM>
unsigned AbstractCardiacMechanicsAssembler< DIM >::GetTotalNumQuadPoints (  )  [inline]

Get the total number of quad points in the mesh. Pure, implemented in concrete assembler

Definition at line 230 of file AbstractCardiacMechanicsAssembler.hpp.

References AbstractCardiacMechanicsAssembler< DIM >::mTotalQuadPoints.

template<unsigned DIM>
virtual bool AbstractCardiacMechanicsAssembler< DIM >::IsImplicitSolver (  )  [protected, pure virtual]

Whether the solver is implicit or not (ie whether the contraction model depends on lambda (and depends on lambda at the current time)). For whether dTa_dLam dependent terms need to be added to the Jacbobian

Implemented in ExplicitCardiacMechanicsAssembler< DIM >, and ImplicitCardiacMechanicsAssembler< DIM >.

Referenced by AbstractCardiacMechanicsAssembler< DIM >::AssembleOnElement().

template<unsigned DIM>
void AbstractCardiacMechanicsAssembler< DIM >::SetCalciumAndVoltage ( std::vector< double > &  rCalciumConcentrations,
std::vector< double > &  rVoltages 
) [inline]

Set the intracellular Calcium concentrations and voltages at each quad point. Pure.

Implicit solvers (for contraction models which are functions of stretch (and maybe stretch rate) would integrate the contraction model with this Ca/V/t using the current stretch (ie inside AssembleOnElement, ie inside GetActiveTensionAndTensionDerivs). Explicit solvers (for contraction models which are NOT functions of stretch can immediately integrate the contraction models to get the active tension.

Parameters:
rCalciumConcentrations Reference to a vector of intracellular calcium concentrations at each quadrature point
rVoltages Reference to a vector of voltages at each quadrature point

Definition at line 292 of file AbstractCardiacMechanicsAssembler.hpp.

References AbstractCardiacMechanicsAssembler< DIM >::mContractionModelSystems, and AbstractCardiacMechanicsAssembler< DIM >::mTotalQuadPoints.

template<unsigned DIM>
void AbstractCardiacMechanicsAssembler< DIM >::SetConstantFibreSheetDirections ( const c_matrix< double, DIM, DIM > &  rFibreSheetMatrix  )  [inline]

Set a constant fibre-sheet-normal direction (a matrix) to something other than the default (fibres in X-direction, sheet in the XY plane)

Parameters:
rFibreSheetMatrix The fibre-sheet-normal matrix (fibre dir the first column, normal-to-fibre-in sheet in second column, sheet-normal in third column).

Definition at line 248 of file AbstractCardiacMechanicsAssembler.hpp.

References AbstractCardiacMechanicsAssembler< DIM >::CheckOrthogonality(), and AbstractCardiacMechanicsAssembler< DIM >::mConstantFibreSheetDirections.

template<unsigned DIM>
void AbstractCardiacMechanicsAssembler< DIM >::SetVariableFibreSheetDirections ( std::string  orthoFile  )  [inline]

Set a variable fibre-sheet-normal direction (matrices), one for each element, from a file. The file should be a .ortho file (ie each line has the fibre dir, sheet dir, normal dir for that element). The number of elements must match the number in the MECHANICS mesh!

Parameters:
orthoFile the file containing the fibre/sheet directions

Definition at line 680 of file AbstractCardiacMechanicsAssembler.hpp.

References AbstractCardiacMechanicsAssembler< DIM >::CheckOrthogonality(), NonlinearElasticityAssembler< DIM >::mpQuadMesh, and AbstractCardiacMechanicsAssembler< DIM >::mpVariableFibreSheetDirections.

template<unsigned DIM>
virtual void AbstractCardiacMechanicsAssembler< DIM >::Solve ( double  time,
double  nextTime,
double  odeTimestep 
) [pure virtual]

Solve for the deformation, integrating the contraction model ODEs.

Parameters:
time the current time
nextTime the next time
odeTimestep the ODE timestep

Implemented in ExplicitCardiacMechanicsAssembler< DIM >, and ImplicitCardiacMechanicsAssembler< DIM >.


Member Data Documentation

template<unsigned DIM>
bool AbstractCardiacMechanicsAssembler< DIM >::mAllocatedMaterialLawMemory [protected]
template<unsigned DIM>
c_matrix<double,DIM,DIM> AbstractCardiacMechanicsAssembler< DIM >::mConstantFibreSheetDirections [protected]

The fibre-sheet-normal directions (in a matrix), if constant (defaults to the identity, ie fibres in the X-direction, sheet in the XY plane)

Definition at line 82 of file AbstractCardiacMechanicsAssembler.hpp.

Referenced by AbstractCardiacMechanicsAssembler< DIM >::AbstractCardiacMechanicsAssembler(), AbstractCardiacMechanicsAssembler< DIM >::AssembleOnElement(), and AbstractCardiacMechanicsAssembler< DIM >::SetConstantFibreSheetDirections().

template<unsigned DIM>
std::vector<AbstractContractionModel*> AbstractCardiacMechanicsAssembler< DIM >::mContractionModelSystems [protected]
template<unsigned DIM>
double AbstractCardiacMechanicsAssembler< DIM >::mCurrentTime [protected]
template<unsigned DIM>
double AbstractCardiacMechanicsAssembler< DIM >::mNextTime [protected]
template<unsigned DIM>
double AbstractCardiacMechanicsAssembler< DIM >::mOdeTimestep [protected]
template<unsigned DIM>
std::vector<c_matrix<double,DIM,DIM> >* AbstractCardiacMechanicsAssembler< DIM >::mpVariableFibreSheetDirections [protected]
template<unsigned DIM>
std::vector<double> AbstractCardiacMechanicsAssembler< DIM >::mStretches [protected]
template<unsigned DIM>
unsigned AbstractCardiacMechanicsAssembler< DIM >::mTotalQuadPoints [protected]

Number of nodes per element

Reimplemented from NonlinearElasticityAssembler< DIM >.

Definition at line 51 of file AbstractCardiacMechanicsAssembler.hpp.

Referenced by AbstractCardiacMechanicsAssembler< DIM >::AssembleOnElement().

Number of vertices per element

Reimplemented from NonlinearElasticityAssembler< DIM >.

Definition at line 52 of file AbstractCardiacMechanicsAssembler.hpp.

Referenced by AbstractCardiacMechanicsAssembler< DIM >::AssembleOnElement().

template<unsigned DIM>
const unsigned AbstractCardiacMechanicsAssembler< DIM >::STENCIL_SIZE = NonlinearElasticityAssembler<DIM>::STENCIL_SIZE [static, protected]

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

Generated by  doxygen 1.6.2