#include <AbstractDynamicAssemblerMixin.hpp>
Inherits AbstractAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >.
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 |
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.
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.
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.
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().
void AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::DoMatrixBasedRhsAssembly | ( | Vec | currentSolution, | |
double | time | |||
) | [inline, protected] |
This method is only called if mUseMatrixBasedRhsAssembly has been set to true (by a sub-class), in which case the subclass should have set up a matrix to do matrix-based RHS assembly, and implemented ConstructVectorForMatrixBasedRhsAssembly. This method just assembles the RHS matrix b by setting up z and doing Bz=b.
currentSolution | ||
time |
Definition at line 165 of file AbstractDynamicAssemblerMixin.hpp.
References AbstractAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ApplyDirichletConditions(), AbstractAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ApplyNeummanBoundaryConditions(), GenericEventHandler< 13, HeartEventHandler >::BeginEvent(), AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ConstructVectorForMatrixBasedRhsAssembly(), GenericEventHandler< 13, HeartEventHandler >::EndEvent(), AbstractAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::FinaliseAssembleSystem(), AbstractAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetLinearSystem(), AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMatrixForMatrixBasedRhsAssembly, AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mVectorForMatrixBasedRhsAssembly, and AbstractAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::PrepareForAssembleSystem().
Referenced by AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
void AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetInitialCondition | ( | Vec | initialCondition | ) | [inline] |
Set the initial condition.
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().
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.
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().
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.
void AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetTimes | ( | double | tStart, | |
double | tEnd, | |||
double | dt | |||
) | [inline] |
Set the times to solve between, and the time step to use.
tStart | the start time | |
tEnd | the end time | |
dt | the time step |
Definition at line 209 of file AbstractDynamicAssemblerMixin.hpp.
References AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mDt, AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mDtInverse, AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mTend, AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mTimesSet, and AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mTstart.
Referenced by CardiacElectroMechanicsProblem< DIM >::Solve().
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.
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().
double AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mDt [protected] |
The simulation time step.
Definition at line 45 of file AbstractDynamicAssemblerMixin.hpp.
Referenced by AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetTimes(), and AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
double AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mDtInverse [protected] |
The inverse of the current time step.
Definition at line 48 of file AbstractDynamicAssemblerMixin.hpp.
Referenced by AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetTimes(), and AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
Vec AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mInitialCondition [protected] |
The initial condition vector.
Definition at line 54 of file AbstractDynamicAssemblerMixin.hpp.
Referenced by AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetInitialCondition(), and AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
bool AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mMatrixIsAssembled [protected] |
Whether the matrix has been assembled for the current time step.
Definition at line 57 of file AbstractDynamicAssemblerMixin.hpp.
Referenced by AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetMatrixIsNotAssembled(), and AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
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().
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().
double AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mTend [protected] |
Simulation end time.
Definition at line 42 of file AbstractDynamicAssemblerMixin.hpp.
Referenced by AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetTimes(), and AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
bool AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mTimesSet [protected] |
Whether SetTimes has been called with suitable parameters.
Definition at line 51 of file AbstractDynamicAssemblerMixin.hpp.
Referenced by AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetTimes(), and AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
double AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mTstart [protected] |
Simulation start time.
Definition at line 39 of file AbstractDynamicAssemblerMixin.hpp.
Referenced by AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetTimes(), and AbstractDynamicAssemblerMixin< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
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().
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().