#include <CardiacNewtonSolver.hpp>
Public Member Functions | |
void | Solve (AbstractBackwardEulerCardiacCell< SIZE > &rCell, double time, double rCurrentGuess[SIZE]) |
Static Public Member Functions | |
static CardiacNewtonSolver < SIZE > * | Instance () |
Protected Member Functions | |
CardiacNewtonSolver () | |
CardiacNewtonSolver (const CardiacNewtonSolver< SIZE > &) | |
CardiacNewtonSolver< SIZE > & | operator= (const CardiacNewtonSolver< SIZE > &) |
double | ComputeNorm (double vector[SIZE]) |
void | SolveLinearSystem () |
Private Attributes | |
double | mResidual [SIZE] |
double | mJacobian [SIZE][SIZE] |
double | mUpdate [SIZE] |
Specialised Newton solver for solving the nonlinear systems arising when simulating a cardiac cell using Backward Euler.
The class is templated by the size of the nonlinear system, and uses the singleton pattern to ensure only 1 solver for any given system size is created. This allows us to be both computationally and memory efficient.
It would be nice to have a test of this class directly, but you need a cardiac cell in order to test it. So all tests occur when testing particular cardiac cells, e.g. the BackwardEulerLuoRudyIModel1991.
Definition at line 48 of file CardiacNewtonSolver.hpp.
CardiacNewtonSolver< SIZE >::CardiacNewtonSolver | ( | ) | [inline, protected] |
Singleton pattern - protected default constructor.
Definition at line 182 of file CardiacNewtonSolver.hpp.
CardiacNewtonSolver< SIZE >::CardiacNewtonSolver | ( | const CardiacNewtonSolver< SIZE > & | ) | [protected] |
Singleton pattern - protected copy constructor. Not implemented.
double CardiacNewtonSolver< SIZE >::ComputeNorm | ( | double | vector[SIZE] | ) | [inline, protected] |
Compute a norm of a vector.
vector | the vector to norm. |
Definition at line 194 of file CardiacNewtonSolver.hpp.
static CardiacNewtonSolver<SIZE>* CardiacNewtonSolver< SIZE >::Instance | ( | ) | [inline, static] |
Call this method to obtain a solver instance.
Definition at line 41 of file CardiacNewtonSolver.hpp.
CardiacNewtonSolver<SIZE>& CardiacNewtonSolver< SIZE >::operator= | ( | const CardiacNewtonSolver< SIZE > & | ) | [protected] |
Singleton pattern - protected assignment operator. Not implemented.
void CardiacNewtonSolver< SIZE >::Solve | ( | AbstractBackwardEulerCardiacCell< SIZE > & | rCell, | |
double | time, | |||
double | rCurrentGuess[SIZE] | |||
) | [inline] |
Use Newton's method to solve the given cell for the next timestep.
rCell | the cell to solve | |
time | the current time | |
rCurrentGuess | the current guess at a solution. Will be updated on exit. |
Definition at line 54 of file CardiacNewtonSolver.hpp.
Referenced by BackwardEulerTenTusscher2006::ComputeOneStepExceptVoltage(), BackwardEulerNobleVargheseKohlNoble1998::ComputeOneStepExceptVoltage(), BackwardEulerMahajanModel2008::ComputeOneStepExceptVoltage(), BackwardEulerLuoRudyIModel1991::ComputeOneStepExceptVoltage(), BackwardEulerFoxModel2002Modified::ComputeOneStepExceptVoltage(), and CML_luo_rudy_1991_pe_lut_be::ComputeOneStepExceptVoltage().
void CardiacNewtonSolver< SIZE >::SolveLinearSystem | ( | ) | [inline, protected] |
Solve a linear system to calculate the Newton update step
Definition at line 210 of file CardiacNewtonSolver.hpp.
double CardiacNewtonSolver< SIZE >::mJacobian[SIZE][SIZE] [private] |
Working memory : Jacobian matrix
Definition at line 241 of file CardiacNewtonSolver.hpp.
double CardiacNewtonSolver< SIZE >::mResidual[SIZE] [private] |
Working memory : residual vector
Definition at line 239 of file CardiacNewtonSolver.hpp.
double CardiacNewtonSolver< SIZE >::mUpdate[SIZE] [private] |
Working memory : update vector
Definition at line 243 of file CardiacNewtonSolver.hpp.