NhsSystemWithImplicitSolver Class Reference

#include <NhsSystemWithImplicitSolver.hpp>

Inheritance diagram for NhsSystemWithImplicitSolver:

Inheritance graph
[legend]
Collaboration diagram for NhsSystemWithImplicitSolver:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 NhsSystemWithImplicitSolver ()
void SetActiveTensionInitialGuess (double activeTensionInitialGuess)
void SolveDoNotUpdate (double startTime, double endTime, double timestep)
void UpdateStateVariables ()
void UseImplicitExplicitSolveForZ (bool useImplicitExplicitSolveForZ=true)
double GetActiveTensionAtNextTime ()

Private Member Functions

void ImplicitSolveForActiveTension ()
double CalcActiveTensionResidual (double activeTensionGuess)
double ImplicitSolveForCaTrop (double newActiveTension)
double ImplicitSolveForZ (double newCaTrop)
double CalcZResidual (double z, double newCaTrop)
double ImplicitExplicitSolveForZ (double newCaTrop)
double ImplicitSolveForQ ()

Private Attributes

double mDt
bool mUseImplicitExplicitSolveForZ
std::vector< double > mTempStoredStateVariables
std::vector< double > mCurrentStateVars
double mActiveTensionInitialGuess
double mActiveTensionSolution

Static Private Attributes

static const double mTolerance = 1e-10


Detailed Description

NHS system with build in implicit solver. Jon Whiteley's method, which breaks down the multivariable implicit solve into a sequence of 1d implicit solves.

The idea is to solve a 1d nonlinear problem for the active tension, where the problem f(T_a)=T_a, where T_a is the current active tension, and f(T_a) is the active tension obtained by assuming this active tension and solving the ODEs as follows:

Given T_a, so compute solution for Ca_trop using backward euler (1d linear problem) Using this Ca_trop, compute solution for z using backward euler (1d nonlinear problem) Solve for Qi implicitly using backward euler (three 1d linear problems) Compute T0, Q and then T_a

Reference: J.P. Whiteley, M.J. Bishop, D.J. Gavaghan "Soft Tissue Modelling of Cardiac Fibres for Use in Coupled Mechano-Electric Simulations"

Definition at line 50 of file NhsSystemWithImplicitSolver.hpp.


Constructor & Destructor Documentation

NhsSystemWithImplicitSolver::NhsSystemWithImplicitSolver (  ) 

Instead of solving an ODE for Qi, assume that the Qi equations reach a static solution on a timescale much smaller than thatt of the deformation, and therefore solve the algebraic equation 0 = A_i lambda_dot - alpha_i Q_i to Q_i(t).

This method returns Q = Q1+Q2+Q3 Constructor

Definition at line 245 of file NhsSystemWithImplicitSolver.cpp.

References NhsCellularMechanicsOdeSystem::GetActiveTension(), AbstractOdeSystem::GetNumberOfStateVariables(), mActiveTensionInitialGuess, mActiveTensionSolution, mTempStoredStateVariables, and mUseImplicitExplicitSolveForZ.


Member Function Documentation

void NhsSystemWithImplicitSolver::ImplicitSolveForActiveTension (  )  [private]

The main Newton solve

Solve a 1d nonlinear system, f(T_a)=T_a, where T_a is the current active tension and f(T_a) is the active tension obtained by assuming this active tension and solving the ODEs as follows

Given T_a, so compute solution for Ca_trop using backward euler (1d linear problem) Using this Ca_trop, compute solution for z using backward euler (1d nonlinear problem) Solve for Qi implicitly using backward euler (three 1d linear problems) Compute T0, Q and then T_a

Definition at line 37 of file NhsSystemWithImplicitSolver.cpp.

References CalcActiveTensionResidual(), mActiveTensionInitialGuess, mActiveTensionSolution, and mTolerance.

Referenced by SolveDoNotUpdate().

double NhsSystemWithImplicitSolver::CalcActiveTensionResidual ( double  activeTensionGuess  )  [private]

double NhsSystemWithImplicitSolver::ImplicitSolveForCaTrop ( double  newActiveTension  )  [private]

Assume the active tension is known and solve for the Ca_trop at the next time implicitly using backward euler. This can be done directly as the rhs is linear in Ca_trop

Parameters:
newActiveTension 

Definition at line 145 of file NhsSystemWithImplicitSolver.cpp.

References NhsCellularMechanicsOdeSystem::mCalciumI, NhsCellularMechanicsOdeSystem::mCalciumTroponinMax, mCurrentStateVars, mDt, NhsCellularMechanicsOdeSystem::mGamma, NhsCellularMechanicsOdeSystem::mKon, NhsCellularMechanicsOdeSystem::mKrefoff, and NhsCellularMechanicsOdeSystem::mTref.

Referenced by CalcActiveTensionResidual().

double NhsSystemWithImplicitSolver::ImplicitSolveForZ ( double  newCaTrop  )  [private]

Assume the Ca_trop is known and solve for the z at the next time implicitly using backward euler. Uses Newton's method.

Parameters:
newCaTrop 

Definition at line 157 of file NhsSystemWithImplicitSolver.cpp.

References CalcZResidual(), mCurrentStateVars, and mTolerance.

Referenced by CalcActiveTensionResidual().

double NhsSystemWithImplicitSolver::CalcZResidual ( double  z,
double  newCaTrop 
) [private]

double NhsSystemWithImplicitSolver::ImplicitExplicitSolveForZ ( double  newCaTrop  )  [private]

double NhsSystemWithImplicitSolver::ImplicitSolveForQ (  )  [private]

void NhsSystemWithImplicitSolver::SetActiveTensionInitialGuess ( double  activeTensionInitialGuess  ) 

Set a current active tension guess. Generally not needed as the current active tension is used if this isn't called.

Parameters:
activeTensionInitialGuess 

Definition at line 255 of file NhsSystemWithImplicitSolver.cpp.

References mActiveTensionInitialGuess.

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

void NhsSystemWithImplicitSolver::SolveDoNotUpdate ( double  startTime,
double  endTime,
double  timestep 
)

Solves for the new state variables at the given end time using the implicit method. Note that the internal state variables are not altered, the solution is saved instead. Call UpdateStateVariables() to update, and GetActiveTensionAtNextTime() to get the solved active tension

The state variables are not updated because this solve will be called as part of the newton iteration (ie guess stretch, see what the new active tension is) in a fully implicit method

Parameters:
startTime 
endTime 
timestep 

Definition at line 261 of file NhsSystemWithImplicitSolver.cpp.

References TimeStepper::AdvanceOneTimeStep(), ImplicitSolveForActiveTension(), TimeStepper::IsTimeAtEnd(), mCurrentStateVars, mDt, AbstractOdeSystem::mStateVariables, and mTempStoredStateVariables.

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

void NhsSystemWithImplicitSolver::UpdateStateVariables (  ) 

Update the state variables using the stored solution. Call after SolveDoNotUpdate() if the solution is to be accepted

Definition at line 285 of file NhsSystemWithImplicitSolver.cpp.

References mCurrentStateVars, and AbstractOdeSystem::mStateVariables.

void NhsSystemWithImplicitSolver::UseImplicitExplicitSolveForZ ( bool  useImplicitExplicitSolveForZ = true  ) 

Solve for z semi-implicitly instead of fully implicitly. If we assume we know Ca_trop solving for z is a 1d nonlinear problem. Call this to treat the problem implicitly in the linear terms on the rhs of dzdt (the (1-z) and (z) terms), and explicitly in the nonlinear term (the z^nr/(z^nr + K^nr) term. This means the problem can be solved directly and no Newton iterations are needed.

Parameters:
useImplicitExplicitSolveForZ 

Definition at line 293 of file NhsSystemWithImplicitSolver.cpp.

References mUseImplicitExplicitSolveForZ.

double NhsSystemWithImplicitSolver::GetActiveTensionAtNextTime (  ) 

Get the active tension corresponding to the stored state variables computed from the last SolveDoNoUpdate(), ie the active tension at the next time. Note that calling GetActiveTension() on the base class will use the internal state variables and return the active tension at the last time, if SolveDoNoUpdate() has been called but UpdateStateVariables() has not

Definition at line 298 of file NhsSystemWithImplicitSolver.cpp.

References mActiveTensionSolution.

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


Member Data Documentation

const double NhsSystemWithImplicitSolver::mTolerance = 1e-10 [static, private]

Tolerance for solving nonlinear system which require newton's method NOTE: 1e-6 doesn't give graphically close results when solving a full problem and comparing implicit with explicit

Definition at line 58 of file NhsSystemWithImplicitSolver.hpp.

Referenced by ImplicitSolveForActiveTension(), and ImplicitSolveForZ().

See SetUseImplicitExplicitSolveForZ()

Definition at line 64 of file NhsSystemWithImplicitSolver.hpp.

Referenced by CalcActiveTensionResidual(), NhsSystemWithImplicitSolver(), and UseImplicitExplicitSolveForZ().

Temporary stored state variables - current guesses to the current solution

Definition at line 67 of file NhsSystemWithImplicitSolver.hpp.

Referenced by CalcActiveTensionResidual(), ImplicitSolveForQ(), NhsSystemWithImplicitSolver(), and SolveDoNotUpdate().

std::vector<double> NhsSystemWithImplicitSolver::mCurrentStateVars [private]

Current state variables to be used in the next timestep

Definition at line 69 of file NhsSystemWithImplicitSolver.hpp.

Referenced by CalcZResidual(), ImplicitExplicitSolveForZ(), ImplicitSolveForCaTrop(), ImplicitSolveForQ(), ImplicitSolveForZ(), SolveDoNotUpdate(), and UpdateStateVariables().

Initial guess for the active tension

Definition at line 72 of file NhsSystemWithImplicitSolver.hpp.

Referenced by ImplicitSolveForActiveTension(), NhsSystemWithImplicitSolver(), and SetActiveTensionInitialGuess().

The solution for the active tension after a SolveDoNotUpdate() has been called

Definition at line 74 of file NhsSystemWithImplicitSolver.hpp.

Referenced by GetActiveTensionAtNextTime(), ImplicitSolveForActiveTension(), and NhsSystemWithImplicitSolver().


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

Generated on Tue Aug 4 16:11:33 2009 for Chaste by  doxygen 1.5.5