AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM > Class Template Reference

#include <AbstractDynamicAssemblerMixin.hpp>

Inherits AbstractAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >.

Collaboration diagram for AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 AbstractDynamicAssemblerMixin ()
void SetTimes (double tStart, double tEnd, double dt)
void SetInitialCondition (Vec initialCondition)
void SetMatrixIsConstant (bool matrixIsConstant=true)
void SetMatrixIsNotAssembled ()
Vec Solve (Vec currentSolutionOrGuess=NULL, double currentTime=0.0)
virtual void ConstructVectorForMatrixBasedRhsAssembly (Vec currentSolution)

Protected Member Functions

void DoMatrixBasedRhsAssembly (Vec currentSolution, double time)

Protected Attributes

double mTstart
double mTend
double mDt
double mDtInverse
bool mTimesSet
Vec mInitialCondition
bool mMatrixIsAssembled
bool mMatrixIsConstant
bool mUseMatrixBasedRhsAssembly
Mat * mpMatrixForMatrixBasedRhsAssembly
Vec mVectorForMatrixBasedRhsAssembly

Detailed Description

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
class AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >

A 'mixin' class to provide assembly of time-dependent problems.

This is designed to be used through multiple inheritance with a suitable static problem assembler. The derived class can then use the Solve method defined here to solve over a time interval.

Definition at line 46 of file AbstractDynamicAssemblerMixin.hpp.


Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::AbstractDynamicAssemblerMixin (  )  [inline]

Constructor notes we haven't been initialised fully yet. The user needs to call SetTimes and SetInitialCondition.

Definition at line 198 of file AbstractDynamicAssemblerMixin.hpp.


Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ConstructVectorForMatrixBasedRhsAssembly ( Vec  currentSolution  )  [inline, virtual]

This method should be overloaded by any subclass which uses matrix-based assembly.

Parameters:
currentSolution the current solution

Reimplemented in BidomainMatrixBasedAssembler< ELEMENT_DIM, SPACE_DIM >, BidomainWithBathMatrixBasedAssembler< ELEMENT_DIM, SPACE_DIM >, and MonodomainMatrixBasedAssembler< ELEMENT_DIM, SPACE_DIM >.

Definition at line 309 of file AbstractDynamicAssemblerMixin.hpp.

Referenced by AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::DoMatrixBasedRhsAssembly().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::DoMatrixBasedRhsAssembly ( Vec  currentSolution,
double  time 
) [inline, protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetInitialCondition ( Vec  initialCondition  )  [inline]

Set the initial condition.

Parameters:
initialCondition the initial condition

Definition at line 231 of file AbstractDynamicAssemblerMixin.hpp.

References AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mInitialCondition.

Referenced by CardiacElectroMechanicsProblem< DIM >::Solve().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetMatrixIsConstant ( bool  matrixIsConstant = true  )  [inline]

Set the boolean mMatrixIsConstant to true to build the matrix only once.

Parameters:
matrixIsConstant whether the matrix is constant (defaults to true)

Definition at line 238 of file AbstractDynamicAssemblerMixin.hpp.

References AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mMatrixIsConstant, and AbstractAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetMatrixIsConst().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetMatrixIsNotAssembled (  )  [inline]

Set the boolean mMatrixIsAssembled to false.

Definition at line 245 of file AbstractDynamicAssemblerMixin.hpp.

References AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mMatrixIsAssembled.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetTimes ( double  tStart,
double  tEnd,
double  dt 
) [inline]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
Vec AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve ( Vec  currentSolutionOrGuess = NULL,
double  currentTime = 0.0 
) [inline]

Solve a dynamic PDE over the time period specified through SetTimes() and the initial conditions specified through SetInitialCondition().

SetTimes() and SetInitialCondition() must be called before Solve(), and the mesh and pde must have been set.

Currently, it is assumed by this code that the matrix is constant for the lifetime of the assembler. In other words, the matrix will *only* be assembled when this method is first called. This is probably not safe in general, but all of our tests use a constant matrix at present.

Parameters:
currentSolutionOrGuess defaults to NULL
currentTime defaults to 0.0

Reimplemented in SimpleDg0ParabolicAssembler< ELEMENT_DIM, SPACE_DIM, NON_HEART, CONCRETE >.

Definition at line 251 of file AbstractDynamicAssemblerMixin.hpp.

References TimeStepper::AdvanceOneTimeStep(), GenericEventHandler< 13, HeartEventHandler >::BeginEvent(), AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::DoMatrixBasedRhsAssembly(), GenericEventHandler< 13, HeartEventHandler >::EndEvent(), AbstractAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetLinearSystem(), TimeStepper::GetNextTimeStep(), TimeStepper::GetTime(), AbstractAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::InitialiseForSolve(), TimeStepper::IsTimeAtEnd(), AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mDt, AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mDtInverse, AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mInitialCondition, AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mMatrixIsAssembled, AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mMatrixIsConstant, AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mTend, AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mTimesSet, AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mTstart, AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mUseMatrixBasedRhsAssembly, AbstractAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::PrepareForSolve(), PdeSimulationTime::SetTime(), and AbstractAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::StaticSolve().

Referenced by CardiacElectroMechanicsProblem< DIM >::Solve().


Member Data Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
double AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mDt [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
double AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mDtInverse [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
Vec AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mInitialCondition [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
bool AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mMatrixIsAssembled [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
bool AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mMatrixIsConstant [protected]

Whether the matrix is constant in time (if so the system need not be assembled at each time step. Defaults to false

Definition at line 61 of file AbstractDynamicAssemblerMixin.hpp.

Referenced by AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetMatrixIsConstant(), and AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
Mat* AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMatrixForMatrixBasedRhsAssembly [protected]

If doing matrix-based assembly for the RHS b, the matrix B in Bz=b

Definition at line 67 of file AbstractDynamicAssemblerMixin.hpp.

Referenced by AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::DoMatrixBasedRhsAssembly().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
double AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mTend [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
bool AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mTimesSet [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
double AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mTstart [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
bool AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mUseMatrixBasedRhsAssembly [protected]

Whether the RHS vector of a linear problem is created by a matrix-vector multiplication

Definition at line 64 of file AbstractDynamicAssemblerMixin.hpp.

Referenced by AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
Vec AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mVectorForMatrixBasedRhsAssembly [protected]

If doing matrix-based assembly for the RHS b, the vector z in Bz=b

Definition at line 70 of file AbstractDynamicAssemblerMixin.hpp.

Referenced by AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::DoMatrixBasedRhsAssembly().


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

Generated by  doxygen 1.6.2