#include <ImplicitCardiacMechanicsAssembler.hpp>
Public Member Functions | |
ImplicitCardiacMechanicsAssembler (QuadraticMesh< DIM > *pQuadMesh, std::string outputDirectory, std::vector< unsigned > &rFixedNodes, AbstractIncompressibleMaterialLaw< DIM > *pMaterialLaw=NULL) | |
~ImplicitCardiacMechanicsAssembler () | |
unsigned | GetTotalNumQuadPoints () |
GaussianQuadratureRule< DIM > * | GetQuadratureRule () |
void | SetIntracellularCalciumConcentrations (std::vector< double > &caI) |
std::vector< double > & | rGetLambda () |
void | Solve (double currentTime, double nextTime, double odeTimestep) |
Private Member Functions | |
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) |
Private Attributes | |
std::vector < NhsSystemWithImplicitSolver > | mCellMechSystems |
std::vector< double > | mLambdaLastTimeStep |
std::vector< double > | mLambda |
double | mCurrentTime |
double | mNextTime |
double | mOdeTimestep |
bool | mAllocatedMaterialLawMemory |
unsigned | mTotalQuadPoints |
Static Private 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 |
Friends | |
class | TestImplicitCardiacMechanicsAssembler |
Solves cardiac mechanics implicitly (together with the NHS cell models for determining the active tension), taking in the intracellular Calcium concentration. See CardiacElectroMechanicsProblem documentation for more detail.
Definition at line 51 of file ImplicitCardiacMechanicsAssembler.hpp.
ImplicitCardiacMechanicsAssembler< DIM >::ImplicitCardiacMechanicsAssembler | ( | QuadraticMesh< DIM > * | pQuadMesh, | |
std::string | outputDirectory, | |||
std::vector< unsigned > & | rFixedNodes, | |||
AbstractIncompressibleMaterialLaw< DIM > * | pMaterialLaw = NULL | |||
) | [inline] |
Constructor
pMesh. | A pointer to the mesh. Should have a surface set as the fixed surface | |
outputDirectory. | The output directory, relative to TEST_OUTPUT | |
pMaterialLaw. | The material law for the tissue. Defaults to NULL, in which case a default material law is used. |
Definition at line 32 of file ImplicitCardiacMechanicsAssembler.cpp.
References GaussianQuadratureRule< ELEM_DIM >::GetNumQuadPoints(), ImplicitCardiacMechanicsAssembler< DIM >::mAllocatedMaterialLawMemory, ImplicitCardiacMechanicsAssembler< DIM >::mCellMechSystems, ImplicitCardiacMechanicsAssembler< DIM >::mLambda, ImplicitCardiacMechanicsAssembler< DIM >::mLambdaLastTimeStep, and ImplicitCardiacMechanicsAssembler< DIM >::mTotalQuadPoints.
ImplicitCardiacMechanicsAssembler< DIM >::~ImplicitCardiacMechanicsAssembler | ( | ) | [inline] |
Destructor just deletes memory if it was allocated
Definition at line 61 of file ImplicitCardiacMechanicsAssembler.cpp.
References ImplicitCardiacMechanicsAssembler< DIM >::mAllocatedMaterialLawMemory.
unsigned ImplicitCardiacMechanicsAssembler< DIM >::GetTotalNumQuadPoints | ( | ) | [inline] |
Get the total number of quad points in the mesh
Definition at line 71 of file ImplicitCardiacMechanicsAssembler.cpp.
References ImplicitCardiacMechanicsAssembler< DIM >::mTotalQuadPoints.
GaussianQuadratureRule< DIM > * ImplicitCardiacMechanicsAssembler< DIM >::GetQuadratureRule | ( | ) | [inline] |
Get the quadrature rule used in the elements
Definition at line 77 of file ImplicitCardiacMechanicsAssembler.cpp.
void ImplicitCardiacMechanicsAssembler< DIM >::SetIntracellularCalciumConcentrations | ( | std::vector< double > & | caI | ) | [inline] |
Set the intracellular Calcium concentrations (note: in an explicit algorithm we would set the active tension as the forcing quantity; the implicit algorithm takes in the Calcium concentration and solves for the active tension implicitly together with the mechanics.
Definition at line 83 of file ImplicitCardiacMechanicsAssembler.cpp.
References ImplicitCardiacMechanicsAssembler< DIM >::mCellMechSystems, and ImplicitCardiacMechanicsAssembler< DIM >::mTotalQuadPoints.
std::vector< double > & ImplicitCardiacMechanicsAssembler< DIM >::rGetLambda | ( | ) | [inline] |
Get lambda (the stretch ratio). NOTE: the i-th entry of this vector is assumed to be the i-th quad point obtained by looping over cells in the obvious way and then looping over quad points. These quad points, in the same order, can be obtained by using the QuadraturePointsGroup class.
Definition at line 93 of file ImplicitCardiacMechanicsAssembler.cpp.
References ImplicitCardiacMechanicsAssembler< DIM >::mLambda.
void ImplicitCardiacMechanicsAssembler< DIM >::Solve | ( | double | currentTime, | |
double | nextTime, | |||
double | odeTimestep | |||
) | [inline] |
Solve for the deformation using quasi-static nonlinear elasticity. (not dynamic nonlinear elasticity, despite the times taken in - just ONE deformation is solved for. The cell models are integrated implicitly over the time range using the ODE timestep provided, as part of the solve, and updated at the end once the solution has been found, as is lambda.
Definition at line 100 of file ImplicitCardiacMechanicsAssembler.cpp.
References NonlinearElasticityAssembler< DIM >::AssembleSystem(), ImplicitCardiacMechanicsAssembler< DIM >::mCellMechSystems, ImplicitCardiacMechanicsAssembler< DIM >::mCurrentTime, ImplicitCardiacMechanicsAssembler< DIM >::mLambdaLastTimeStep, ImplicitCardiacMechanicsAssembler< DIM >::mNextTime, and ImplicitCardiacMechanicsAssembler< DIM >::mOdeTimestep.
void ImplicitCardiacMechanicsAssembler< 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, private, 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): calculating Ta implicitly and using it to compute the stress, and the addition of a corresponding extra term to the Jacobian
Reimplemented from NonlinearElasticityAssembler< DIM >.
Definition at line 128 of file ImplicitCardiacMechanicsAssembler.cpp.
References AbstractIncompressibleMaterialLaw< DIM >::ComputeStressAndStressDerivative(), NhsSystemWithImplicitSolver::GetActiveTensionAtNextTime(), GaussianQuadratureRule< ELEM_DIM >::GetNumQuadPoints(), GaussianQuadratureRule< ELEM_DIM >::GetWeight(), ImplicitCardiacMechanicsAssembler< DIM >::mCellMechSystems, ImplicitCardiacMechanicsAssembler< DIM >::mCurrentTime, ImplicitCardiacMechanicsAssembler< DIM >::mLambda, ImplicitCardiacMechanicsAssembler< DIM >::mLambdaLastTimeStep, ImplicitCardiacMechanicsAssembler< DIM >::mNextTime, ImplicitCardiacMechanicsAssembler< DIM >::mOdeTimestep, NonlinearElasticityAssembler< DIM >::mpQuadMesh, GaussianQuadratureRule< ELEM_DIM >::rGetQuadPoint(), NhsSystemWithImplicitSolver::SetActiveTensionInitialGuess(), NhsCellularMechanicsOdeSystem::SetLambdaAndDerivative(), and NhsSystemWithImplicitSolver::SolveDoNotUpdate().
std::vector<NhsSystemWithImplicitSolver> ImplicitCardiacMechanicsAssembler< DIM >::mCellMechSystems [private] |
The NHS cell systems (with their own implicit solvers, which take in [Ca]_i and return Ta. Note the indexing: the i-th entry corresponds to the i-th global quad point, when looping over elements and then quad points
Definition at line 64 of file ImplicitCardiacMechanicsAssembler.hpp.
Referenced by ImplicitCardiacMechanicsAssembler< DIM >::AssembleOnElement(), ImplicitCardiacMechanicsAssembler< DIM >::ImplicitCardiacMechanicsAssembler(), ImplicitCardiacMechanicsAssembler< DIM >::SetIntracellularCalciumConcentrations(), and ImplicitCardiacMechanicsAssembler< DIM >::Solve().
std::vector<double> ImplicitCardiacMechanicsAssembler< DIM >::mLambdaLastTimeStep [private] |
The stretch ratio (in the fibre direction) at the last timestep. Note the indexing: the i-th entry corresponds to the i-th global quad point, when looping over elements and then quad points
Definition at line 70 of file ImplicitCardiacMechanicsAssembler.hpp.
Referenced by ImplicitCardiacMechanicsAssembler< DIM >::AssembleOnElement(), ImplicitCardiacMechanicsAssembler< DIM >::ImplicitCardiacMechanicsAssembler(), and ImplicitCardiacMechanicsAssembler< DIM >::Solve().
std::vector<double> ImplicitCardiacMechanicsAssembler< DIM >::mLambda [private] |
The current stretch ratio (in the fibre direction). Note the indexing: the i-th entry corresponds to the i-th global quad point, when looping over elements and then quad points
Definition at line 76 of file ImplicitCardiacMechanicsAssembler.hpp.
Referenced by ImplicitCardiacMechanicsAssembler< DIM >::AssembleOnElement(), ImplicitCardiacMechanicsAssembler< DIM >::ImplicitCardiacMechanicsAssembler(), and ImplicitCardiacMechanicsAssembler< DIM >::rGetLambda().
double ImplicitCardiacMechanicsAssembler< DIM >::mCurrentTime [private] |
Current time
Definition at line 79 of file ImplicitCardiacMechanicsAssembler.hpp.
Referenced by ImplicitCardiacMechanicsAssembler< DIM >::AssembleOnElement(), and ImplicitCardiacMechanicsAssembler< DIM >::Solve().
double ImplicitCardiacMechanicsAssembler< DIM >::mNextTime [private] |
Time to which the solver has been asked to solve to
Definition at line 81 of file ImplicitCardiacMechanicsAssembler.hpp.
Referenced by ImplicitCardiacMechanicsAssembler< DIM >::AssembleOnElement(), and ImplicitCardiacMechanicsAssembler< DIM >::Solve().
double ImplicitCardiacMechanicsAssembler< DIM >::mOdeTimestep [private] |
Time used to integrate the NHS model
Definition at line 83 of file ImplicitCardiacMechanicsAssembler.hpp.
Referenced by ImplicitCardiacMechanicsAssembler< DIM >::AssembleOnElement(), and ImplicitCardiacMechanicsAssembler< DIM >::Solve().
bool ImplicitCardiacMechanicsAssembler< DIM >::mAllocatedMaterialLawMemory [private] |
Whether the material law was passed in or the default used
Definition at line 86 of file ImplicitCardiacMechanicsAssembler.hpp.
Referenced by ImplicitCardiacMechanicsAssembler< DIM >::ImplicitCardiacMechanicsAssembler(), and ImplicitCardiacMechanicsAssembler< DIM >::~ImplicitCardiacMechanicsAssembler().
unsigned ImplicitCardiacMechanicsAssembler< DIM >::mTotalQuadPoints [private] |
Total number of quad points in the (mechanics) mesh
Definition at line 89 of file ImplicitCardiacMechanicsAssembler.hpp.
Referenced by ImplicitCardiacMechanicsAssembler< DIM >::GetTotalNumQuadPoints(), ImplicitCardiacMechanicsAssembler< DIM >::ImplicitCardiacMechanicsAssembler(), and ImplicitCardiacMechanicsAssembler< DIM >::SetIntracellularCalciumConcentrations().