CardiacNewtonSolver< SIZE > Class Template Reference

#include <CardiacNewtonSolver.hpp>

Collaboration diagram for CardiacNewtonSolver< SIZE >:

Collaboration graph
[legend]

List of all members.

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 > &)
void SolveLinearSystem ()

Private Attributes

c_vector< double, SIZE > mResidual
double mJacobian [SIZE][SIZE]
c_vector< double, SIZE > mUpdate


Detailed Description

template<unsigned SIZE>
class CardiacNewtonSolver< 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 LuoRudy1991BackwardEuler.

Definition at line 50 of file CardiacNewtonSolver.hpp.


Constructor & Destructor Documentation

template<unsigned SIZE>
CardiacNewtonSolver< SIZE >::CardiacNewtonSolver (  )  [inline, protected]

Singleton pattern - protected default constructor.

Definition at line 152 of file CardiacNewtonSolver.hpp.

template<unsigned SIZE>
CardiacNewtonSolver< SIZE >::CardiacNewtonSolver ( const CardiacNewtonSolver< SIZE > &   )  [protected]

Singleton pattern - protected copy constructor. Not implemented.


Member Function Documentation

template<unsigned SIZE>
static CardiacNewtonSolver<SIZE>* CardiacNewtonSolver< SIZE >::Instance (  )  [inline, static]

Call this method to obtain a solver instance.

Returns:
a single instance of the class

Definition at line 58 of file CardiacNewtonSolver.hpp.

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

Parameters:
rCell the cell to solve
time the current time
rCurrentGuess the current guess at a solution. Will be updated on exit.

Definition at line 71 of file CardiacNewtonSolver.hpp.

References AbstractBackwardEulerCardiacCell< SIZE >::ComputeJacobian(), AbstractBackwardEulerCardiacCell< SIZE >::ComputeResidual(), CardiacNewtonSolver< SIZE >::mJacobian, CardiacNewtonSolver< SIZE >::mResidual, CardiacNewtonSolver< SIZE >::mUpdate, CardiacNewtonSolver< SIZE >::SolveLinearSystem(), and TERMINATE.

template<unsigned SIZE>
CardiacNewtonSolver<SIZE>& CardiacNewtonSolver< SIZE >::operator= ( const CardiacNewtonSolver< SIZE > &   )  [protected]

Singleton pattern - protected assignment operator. Not implemented.

template<unsigned SIZE>
void CardiacNewtonSolver< SIZE >::SolveLinearSystem (  )  [inline, protected]

Solve a linear system to calculate the Newton update step

This is solving Jacbian . update = residual for update given values of the Jacobian matrix and residual

The implementation does Gaussian elimination with no pivotting and no underflow checking

Definition at line 168 of file CardiacNewtonSolver.hpp.

References CardiacNewtonSolver< SIZE >::mJacobian, CardiacNewtonSolver< SIZE >::mResidual, and CardiacNewtonSolver< SIZE >::mUpdate.

Referenced by CardiacNewtonSolver< SIZE >::Solve().


Member Data Documentation

template<unsigned SIZE>
c_vector<double, SIZE> CardiacNewtonSolver< SIZE >::mResidual [private]

Working memory : residual vector

Definition at line 196 of file CardiacNewtonSolver.hpp.

Referenced by CardiacNewtonSolver< SIZE >::Solve(), and CardiacNewtonSolver< SIZE >::SolveLinearSystem().

template<unsigned SIZE>
double CardiacNewtonSolver< SIZE >::mJacobian[SIZE][SIZE] [private]

Working memory : Jacobian matrix

Definition at line 198 of file CardiacNewtonSolver.hpp.

Referenced by CardiacNewtonSolver< SIZE >::Solve(), and CardiacNewtonSolver< SIZE >::SolveLinearSystem().

template<unsigned SIZE>
c_vector<double, SIZE> CardiacNewtonSolver< SIZE >::mUpdate [private]

Working memory : update vector

Definition at line 200 of file CardiacNewtonSolver.hpp.

Referenced by CardiacNewtonSolver< SIZE >::Solve(), and CardiacNewtonSolver< SIZE >::SolveLinearSystem().


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

Generated on Mon Nov 1 12:36:17 2010 for Chaste by  doxygen 1.5.5