CEPS
24.01
Cardiac ElectroPhysiology Simulator
|
Astract Problem which does depend on time.
Definition at line 36 of file AbstractTimedPdeProblem.hpp.
#include <AbstractTimedPdeProblem.hpp>
Public Member Functions | |
AbstractTimedPdeProblem (Geometry *geom, InputParameters *params=nullptr) | |
Constructor with geometry and optional parameters. More... | |
void | setupWithParameters (InputParameters *params) override |
Set attributes from input file. Parameters are passed as arguments in case one wants to use other parameters. More... | |
CepsReal | getStartTime () const override |
pde start time More... | |
CepsReal | getEndTime () const override |
pde end time More... | |
CepsReal | getTimeStep () const |
pde time step More... | |
void | setTimes (CepsReal tStart, CepsReal tEnd, CepsReal dt) |
Define the start and end times, also time step. More... | |
CepsReal | getSnapshotTime () const override |
Periodicity of outputs, in time units. More... | |
void | setSnapshotTime (CepsReal st) |
Periodicity of outputs, in time units. More... | |
virtual void | defineInitialCondition () |
Sets the pointer on function for initial guess. Here it is set to nullptr, so it will be 0. More... | |
virtual void | getInitialCondition (DHVecPtr v) const |
Build vector from function pointed by m_initialCondition. More... | |
void | initializeEquation () override |
Initializes equations (unknowns, bc, source term) and creates the spatial discretization This method should be called at the start of run() methods. More... | |
CepsArray2< CepsArray3< CepsArray3< CepsReal > > > | getErrors () const |
Get the errors. More... | |
CepsBool | canComputeErrorAtTime (CepsReal t) const |
Tells if either analytic solution or reference solution has a snapshot at time t. More... | |
Public Member Functions inherited from AbstractPdeProblem | |
AbstractPdeProblem (Geometry *geom, InputParameters *params=nullptr) | |
Constructor with geometry and optional parameters. More... | |
virtual | ~AbstractPdeProblem () |
destructor More... | |
AbstractPdeProblem (const AbstractPdeProblem &that)=delete | |
No copy constructor. More... | |
AbstractPdeProblem & | operator= (const AbstractPdeProblem &that)=delete |
No assignment operator. More... | |
InputParameters * | getParameters () const |
Text parameters. More... | |
virtual void | run () |
Computes the solution to the problem. Default does nothing, override it ! More... | |
void | setProblemName (const CepsString &name) |
Set the name of the problem. More... | |
CepsString | getProblemName () const |
Get the name of the problem. More... | |
Geometry * | getGeometry () const |
Link to geometry on which the pb is defined. More... | |
AbstractDiscretization * | getSpatialDiscretization () const |
Link to the spatial discretization (FE, FV, etc) More... | |
void | setSpatialDiscretization (AbstractDiscretization *discr) |
Link to the spatial discretization (FE, FV, etc) More... | |
void | createSpatialDiscretization () |
Compute the discretization structure. More... | |
virtual void | defineUnknowns ()=0 |
Define all the unknowns of the problem here. Must be overriden, and call all necessary addUnknown, addZeroDUnknown, addUnknownInteraction. More... | |
const CepsVector< Unknown * > & | getUnknowns () const |
List of unknowns of the pb. More... | |
Unknown * | getUnknown (const CepsString &label) const |
Get an unknown by its name. More... | |
Unknown * | getUnknown (CepsUnknownIndex uid) const |
Get an unknown by its id. More... | |
CepsVector< Unknown * > | getSpatialUnknowns () const |
A vector of all unknowns of pb defined on cells or points. More... | |
CepsVector< Unknown * > | getZeroDUnknowns () const |
A vector of all zeroD unknowns of the pb. More... | |
const CepsVector< UnknownInteraction * > & | getUnknownsInteractions () const |
All the interactions between unknowns. More... | |
CepsBool | unknownsInteract (Unknown *u1, Unknown *u2, const CepsSet< CepsAttribute > &attrs={CepsUniversal}) const |
Tells if unknowns interact on an entity with attributes. More... | |
CepsBool | ignoreZeroDUnknownsForError () const |
Tells if 0D must not be taken into account in error computation. More... | |
CepsBool | hasAnalyticSolution () const |
Tells if there is an analytic or reference solution. More... | |
ScalarFunction * | getAnalyticSolution () const |
Pointer on analytic or refScalarFunction solution. More... | |
virtual void | defineAnalyticSolution () |
Set directly the analytic function, default sets no solution, unless there is a collection of reference solution files, provided at init or from parameters. More... | |
void | setReferenceSolution (const CepsString &baseFiles, CepsReal snapDt) |
Externally define the referece solution from files. Can be used for convergence tests. More... | |
CepsBool | usesReferenceSolution () const |
Tells if analytic solution and if it is loaded from files. More... | |
CepsReal | getReferenceSolutionOutputPeriod () const |
Output dt of reference. More... | |
FunctionDictionary * | getFunctionDictionary () const |
Get functions manager. More... | |
void | setFunctionDictionary (FunctionDictionary *) |
Set functions manager. More... | |
virtual void | defineBoundaryConditions () |
Define the boundary conditions. Should be defined in derived classes. Default is no BC. More... | |
BoundaryConditionManager * | getBoundaryConditionManager () const |
Get boundary condition manager. More... | |
void | setBoundaryConditionManager (BoundaryConditionManager *bcm) |
Set boundary condition manager. More... | |
virtual void | defineSourceTerms () |
Define the source terms. Should be defined in derived classes. Default is no src term. More... | |
SourceTermManager * | getSourceTermManager () const |
Get boundary condition manager. More... | |
void | setSourceTermManager (SourceTermManager *stm) |
Set boundary condition manager. More... | |
CepsString | getOutputFileBase () const |
Output file name includes the directory. More... | |
void | setOutputFileBase (CepsString fileName) |
Output file name includes the directory. More... | |
CepsOutputFormat | getOutputFormat () const |
Tells if output is binary or ascii. More... | |
void | setOutputFormat (CepsOutputFormat opt) |
Enable/disable binary output. More... | |
CepsBool | writesGlobalIndices () const |
Tells if global indices are written on top of solution. More... | |
void | writeGlobalIndices (CepsBool opt) |
Activate/deactivate global indices writing. More... | |
CepsVector< CepsReal3D > | getProbePoints () const |
Returns points where single data output should be written. More... | |
Public Member Functions inherited from CepsObject | |
CepsObject ()=default | |
default constructor More... | |
CepsObject (const CepsObject &)=default | |
Copy constructor. More... | |
virtual | ~CepsObject ()=default |
Destructor. More... | |
CepsObject & | operator= (const CepsObject &)=default |
Assignment operator. More... | |
CepsObject * | toBaseObject () |
Returns a pointer to CepsObject class. More... | |
const CepsObject * | toBaseObject () const |
Returns a pointer to CepsObject class, const version. More... | |
Profiler * | getProfiler () const |
Access to profiler. More... | |
Static Public Attributes | |
static constexpr CepsBool | isStatic = false |
Flag for static/timed. More... | |
Protected Attributes | |
CepsReal | m_pdeStartTime |
Initial time. More... | |
CepsReal | m_pdeEndTime |
End time. More... | |
CepsReal | m_pdeTimeStep |
Time Step for the PDE. More... | |
CepsReal | m_pdeSnapshotTime |
Periodicity of outputs. More... | |
ScalarFunction * | m_initialCondition |
Function defining the initial condition, which is 0 if pointer is null. More... | |
CepsArray2< CepsArray3< CepsArray3< CepsReal > > > | m_errors |
Will store Linf, L1 and L2 relative errors. More... | |
Protected Attributes inherited from AbstractPdeProblem | |
CepsString | m_name |
Name of the problem. More... | |
Geometry * | m_geom |
Link to geometry on which the pb is defined. More... | |
InputParameters * | m_parameters |
Input file data. More... | |
AbstractDiscretization * | m_discr |
Discretization method (eg FE for now) More... | |
CepsBool | m_ownedDiscr |
True if instance used new to create discretization. More... | |
CepsVector< Unknown * > | m_unknowns |
All maths unknowns of the problem. More... | |
CepsVector< UnknownInteraction * > | m_unknownsInteractions |
Describes how unknowns interact. More... | |
ScalarFunction * | m_analyticSolution |
analytic or reference solution More... | |
CepsBool | m_ownedRefSol |
Flag for reference ownership. More... | |
CepsString | m_refSolFiles |
base name of reference solution file, if any More... | |
CepsReal | m_refSolSnapDt |
reference solution output period More... | |
FunctionDictionary * | m_functions |
Collection of custom functions. More... | |
BoundaryConditionManager * | m_boundaryConditions |
All BCs should be there. More... | |
SourceTermManager * | m_sourceTerms |
All source terms. More... | |
CepsBool | m_ownedFunctions |
True if instance used new to create dictionary. More... | |
CepsBool | m_ownedBCs |
True if instance used new to create BC manager. More... | |
CepsBool | m_ownedSrcs |
True if instance used new to create src term manager. More... | |
CepsString | m_outputFileBase |
File names prefix. More... | |
CepsOutputFormat | m_outputFormat |
Output format selector. More... | |
CepsBool | m_writeGlobalIDs |
Writes CEPS indices as well. More... | |
CepsVector< CepsReal3D > | m_probePoints |
Single point data outputs. More... | |
CepsBool | m_ignoreZeroDError |
Ignore 0D unknowns when computing errors. More... | |
Additional Inherited Members | |
Public Types inherited from AbstractPdeProblem | |
using | ScalarFunction = ceps::Function< CepsReal(CepsStandardArgs)> |
Typedef for analytic solution. More... | |
Protected Member Functions inherited from AbstractPdeProblem | |
void | addUnknown (const CepsString &label, CepsSet< CepsAttribute > attrs={}, CepsLocationFlag flag=CepsLocationFlag::Point, const CepsString &unit="") |
Register a new unknown. More... | |
void | addZeroDUnknown (CepsString label, const CepsString &unit="") |
Register a new unknown, defined outside of geometry. More... | |
void | addUnknownInteraction (CepsString label1, CepsString label2, CepsSet< CepsAttribute > attrs={}) |
Register interaction between unknowns. Also sets the interaction within Unknown instances label1 and label2. More... | |
Static Protected Attributes inherited from CepsObject | |
static Profiler | m_profiler |
The same profiler for each big object. More... | |
|
explicit |
Constructor with geometry and optional parameters.
geom | Geometry, required, otherwise it's not a pde |
params | Simulation parameters (nullptr = defaults) |
Definition at line 36 of file AbstractTimedPdeProblem.cpp.
Tells if either analytic solution or reference solution has a snapshot at time t.
Definition at line 135 of file AbstractTimedPdeProblem.cpp.
|
virtual |
Sets the pointer on function for initial guess. Here it is set to nullptr, so it will be 0.
Definition at line 108 of file AbstractTimedPdeProblem.cpp.
|
overridevirtual |
pde end time
Reimplemented from AbstractPdeProblem.
Definition at line 66 of file AbstractTimedPdeProblem.cpp.
CepsArray2< CepsArray3< CepsArray3< CepsReal > > > AbstractTimedPdeProblem::getErrors | ( | ) | const |
Get the errors.
Definition at line 129 of file AbstractTimedPdeProblem.cpp.
|
virtual |
Build vector from function pointed by m_initialCondition.
Reimplemented in PacemakerPoissonProblem, PacemakerBidomainProblem, CardiacProblem, and BidomainProblem.
Definition at line 114 of file AbstractTimedPdeProblem.cpp.
|
overridevirtual |
Periodicity of outputs, in time units.
Reimplemented from AbstractPdeProblem.
Definition at line 89 of file AbstractTimedPdeProblem.cpp.
|
overridevirtual |
pde start time
Reimplemented from AbstractPdeProblem.
Definition at line 60 of file AbstractTimedPdeProblem.cpp.
CepsReal AbstractTimedPdeProblem::getTimeStep | ( | ) | const |
pde time step
Definition at line 72 of file AbstractTimedPdeProblem.cpp.
|
overridevirtual |
Initializes equations (unknowns, bc, source term) and creates the spatial discretization This method should be called at the start of run() methods.
Reimplemented from AbstractPdeProblem.
Definition at line 122 of file AbstractTimedPdeProblem.cpp.
void AbstractTimedPdeProblem::setSnapshotTime | ( | CepsReal | st | ) |
Periodicity of outputs, in time units.
Definition at line 95 of file AbstractTimedPdeProblem.cpp.
Define the start and end times, also time step.
Definition at line 78 of file AbstractTimedPdeProblem.cpp.
|
overridevirtual |
Set attributes from input file. Parameters are passed as arguments in case one wants to use other parameters.
Reimplemented from AbstractPdeProblem.
Reimplemented in HeatProblem.
Definition at line 51 of file AbstractTimedPdeProblem.cpp.
|
staticconstexpr |
Flag for static/timed.
Definition at line 104 of file AbstractTimedPdeProblem.hpp.
|
protected |
Will store Linf, L1 and L2 relative errors.
Definition at line 118 of file AbstractTimedPdeProblem.hpp.
|
protected |
Function defining the initial condition, which is 0 if pointer is null.
Definition at line 115 of file AbstractTimedPdeProblem.hpp.
|
protected |
End time.
Definition at line 110 of file AbstractTimedPdeProblem.hpp.
|
protected |
Periodicity of outputs.
Definition at line 112 of file AbstractTimedPdeProblem.hpp.
|
protected |
Initial time.
Definition at line 109 of file AbstractTimedPdeProblem.hpp.
|
protected |
Time Step for the PDE.
Definition at line 111 of file AbstractTimedPdeProblem.hpp.