CEPS  24.01
Cardiac ElectroPhysiology Simulator
CardiacProblem Class Referenceabstract

Detailed Description

A abstract class that regroups common parameters of cardiac problems.

Definition at line 36 of file CardiacProblem.hpp.

#include <CardiacProblem.hpp>

Inheritance diagram for CardiacProblem:
[legend]

Data Structures

class  FiberAligner
 A functor that aligns conductivities along the fibers directions. More...
 
struct  UnknownsName
 name of unknowns in a struct More...
 

Public Member Functions

 CardiacProblem (Geometry *g, InputParameters *params=nullptr)
 Constructor with input file and geometry. More...
 
 ~CardiacProblem () override
 Destructor. More...
 
virtual CepsVector< Unknown * > getTMVUnknowns () const =0
 Returns a vector containing all unknowns that are a TMV (especially useful for bilayer) More...
 
virtual CepsVector< Unknown * > getCardiacUnknowns () const =0
 Returns a vector containing all unknowns that are cardiac unknowns (eg. vm, ui or ue) More...
 
void getInitialCondition (DHVecPtr v) const override
 Zero + asks each ionic model to fill the parts of the Vm vector with its initial value. More...
 
CepsVector< AbstractIonicModel * > getIonicModels () const
 Vector of all initd ionic models. More...
 
ScalarField< DegreeOfFreedom > * getAm () const
 Link to Am coefficient. More...
 
ScalarField< DegreeOfFreedom > * getCm () const
 Link to Cm coefficient. More...
 
TensorField< GeomCell > * getSigmaI () const
 Link to intracellular conductivity. More...
 
TensorField< GeomCell > * getSigmaE () const
 Link to extracellular conductivity. More...
 
const CepsSet< CepsAttribute > & getTissueAttributes () const
 All attributes that localize tissue. More...
 
void initializeEquation () override
 Initializes all the elements of the PDE from options. More...
 
void initializeCm ()
 Sets the membrane conductivity from the input parameters. More...
 
void initializeAm ()
 Set the surface of membrane from input parameters. More...
 
void initializeIonicModels ()
 Creates and assign ionic models to tissue regions from input string. More...
 
virtual void initializeConductivities ()
 Generates the functors that compute conductivity either from inputs or volume fraction. More...
 
virtual void initializeConductivities (CepsString sigmaIOpts, CepsString sigmaEOpts, TensorField< GeomCell > *&sigmaI, TensorField< GeomCell > *&sigmaE, CepsString fiberOptions, CepsString suffix="")
 Generates the functors that compute conductivity either from inputs or volume fraction. More...
 
virtual void initializeStimulations ()
 Generates stimulations and links them to ionic models. Called within define source terms. More...
 
void defineBoundaryConditions () override
 For cardiac problems, use the "boundary stimulation" key to create boundary conditions using the same syntax as internal. More...
 
void defineSourceTerms () override
 For cardiac problem, only calls initializeStimulation. Can be overriden. More...
 
- Public Member Functions inherited from HeatProblem
 HeatProblem (Geometry *g, InputParameters *p=nullptr, const CepsMathTensor &k=CepsMathTensor::Identity())
 Constructor from geometry and optional input file. More...
 
 ~HeatProblem () override
 Destructor. 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...
 
void defineUnknowns () override
 Lists the unknowns of the problem (one here) More...
 
void defineSourceTerms () override
 Lists the unknowns of the problem (one here) More...
 
virtual CepsMathTensor getDiffusionTensor (Unknown *u=nullptr) const
 Diffusion tensor. More...
 
void run () override
 Computes the solution. More...
 
- Public Member Functions inherited from AbstractTimedPdeProblem
 AbstractTimedPdeProblem (Geometry *geom, InputParameters *params=nullptr)
 Constructor with geometry and optional 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...
 
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...
 
AbstractPdeProblemoperator= (const AbstractPdeProblem &that)=delete
 No assignment operator. More...
 
InputParametersgetParameters () const
 Text parameters. More...
 
void setProblemName (const CepsString &name)
 Set the name of the problem. More...
 
CepsString getProblemName () const
 Get the name of the problem. More...
 
GeometrygetGeometry () const
 Link to geometry on which the pb is defined. More...
 
AbstractDiscretizationgetSpatialDiscretization () 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...
 
const CepsVector< Unknown * > & getUnknowns () const
 List of unknowns of the pb. More...
 
UnknowngetUnknown (const CepsString &label) const
 Get an unknown by its name. More...
 
UnknowngetUnknown (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...
 
ScalarFunctiongetAnalyticSolution () 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...
 
FunctionDictionarygetFunctionDictionary () const
 Get functions manager. More...
 
void setFunctionDictionary (FunctionDictionary *)
 Set functions manager. More...
 
BoundaryConditionManagergetBoundaryConditionManager () const
 Get boundary condition manager. More...
 
void setBoundaryConditionManager (BoundaryConditionManager *bcm)
 Set boundary condition manager. More...
 
SourceTermManagergetSourceTermManager () 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< CepsReal3DgetProbePoints () 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...
 
CepsObjectoperator= (const CepsObject &)=default
 Assignment operator. More...
 
CepsObjecttoBaseObject ()
 Returns a pointer to CepsObject class. More...
 
const CepsObjecttoBaseObject () const
 Returns a pointer to CepsObject class, const version. More...
 
ProfilergetProfiler () const
 Access to profiler. More...
 

Protected Member Functions

void setupWithParameters (InputParameters *params) override
 Sets options from the parameters. More...
 
void createFibersAndConductivities (CepsString fiberOptions, TensorField< GeomCell > *&sigmaI, TensorField< GeomCell > *&sigmaE, CepsString suffix="")
 Creates the entries in the dictionary for each direction of fibers from file This is splitted from initializeConductivities for BilayerMonodomain where several fiber orientations exist per cell. 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...
 

Protected Attributes

CepsString m_CmOptions
 Options for membrance capacitance. More...
 
CepsString m_AmOptions
 Options for membrane surface. More...
 
CepsString m_ionOptions
 Options for ionic models. More...
 
CepsString m_fibersOptions
 Options for fiber orientation. More...
 
CepsString m_sigmaIOptions
 Options for intracellular conductivity. More...
 
CepsString m_sigmaEOptions
 Options for extracellulat conductivity. More...
 
CepsString m_volFracOptions
 Options for volume fraction. More...
 
CepsString m_volFracItpFileI
 Options for volume fraction. More...
 
CepsString m_volFracItpFileE
 Options for volume fraction. More...
 
CepsString m_stimOptions
 Options for stimulation. More...
 
CepsString m_bcStimOptions
 Options for stimulation, on boundary. More...
 
CepsSet< CepsAttributem_tissueAttributes
 Identifier for the tissue region, default {-1}. More...
 
ScalarField< DegreeOfFreedom > * m_Cm
 Membrane capacitance, may depend on x and t. More...
 
ScalarField< DegreeOfFreedom > * m_Am
 Surface (cm2) of cell membrane per cm3 of myocardium. More...
 
CepsVector< AbstractIonicModel * > m_ionicModels
 All ionic models defined on the tissue. More...
 
TensorField< GeomCell > * m_sigmaI
 Intracellular conductivity, defined on cells. More...
 
TensorField< GeomCell > * m_sigmaE
 Extracellulat conductivity, defined on cells. More...
 
ScalarField< GeomCell > * m_volFrac
 Fraction of tissue made of valid myocytes. More...
 
- Protected Attributes inherited from HeatProblem
CepsMathTensor m_k
 Diffusion tensor. More...
 
- Protected Attributes inherited from AbstractTimedPdeProblem
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...
 
ScalarFunctionm_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...
 
Geometrym_geom
 Link to geometry on which the pb is defined. More...
 
InputParametersm_parameters
 Input file data. More...
 
AbstractDiscretizationm_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...
 
ScalarFunctionm_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...
 
FunctionDictionarym_functions
 Collection of custom functions. More...
 
BoundaryConditionManagerm_boundaryConditions
 All BCs should be there. More...
 
SourceTermManagerm_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< CepsReal3Dm_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...
 
- Static Public Attributes inherited from AbstractTimedPdeProblem
static constexpr CepsBool isStatic = false
 Flag for static/timed. More...
 
- Static Protected Attributes inherited from CepsObject
static Profiler m_profiler
 The same profiler for each big object. More...
 

Constructor & Destructor Documentation

◆ CardiacProblem()

CardiacProblem::CardiacProblem ( Geometry g,
InputParameters params = nullptr 
)
explicit

Constructor with input file and geometry.

Definition at line 36 of file CardiacProblem.cpp.

◆ ~CardiacProblem()

CardiacProblem::~CardiacProblem ( )
override

Destructor.

Definition at line 62 of file CardiacProblem.cpp.

Member Function Documentation

◆ createFibersAndConductivities()

void CardiacProblem::createFibersAndConductivities ( CepsString  fiberOptions,
TensorField< GeomCell > *&  sigmaI,
TensorField< GeomCell > *&  sigmaE,
CepsString  suffix = "" 
)
protected

Creates the entries in the dictionary for each direction of fibers from file This is splitted from initializeConductivities for BilayerMonodomain where several fiber orientations exist per cell.

Definition at line 411 of file CardiacProblem.cpp.

◆ defineBoundaryConditions()

void CardiacProblem::defineBoundaryConditions ( )
overridevirtual

For cardiac problems, use the "boundary stimulation" key to create boundary conditions using the same syntax as internal.

Reimplemented from AbstractPdeProblem.

Reimplemented in ExtendedBidomainProblem, and CLMonodomainProblem.

Definition at line 373 of file CardiacProblem.cpp.

◆ defineSourceTerms()

void CardiacProblem::defineSourceTerms ( )
overridevirtual

For cardiac problem, only calls initializeStimulation. Can be overriden.

Reimplemented from AbstractPdeProblem.

Definition at line 405 of file CardiacProblem.cpp.

◆ getAm()

ScalarField< DegreeOfFreedom > * CardiacProblem::getAm ( ) const

Link to Am coefficient.

Definition at line 89 of file CardiacProblem.cpp.

◆ getCardiacUnknowns()

virtual CepsVector<Unknown*> CardiacProblem::getCardiacUnknowns ( ) const
pure virtual

Returns a vector containing all unknowns that are cardiac unknowns (eg. vm, ui or ue)

Implemented in MonodomainProblem, BilayerMonodomainProblem, and BidomainProblem.

◆ getCm()

ScalarField< DegreeOfFreedom > * CardiacProblem::getCm ( ) const

Link to Cm coefficient.

Definition at line 95 of file CardiacProblem.cpp.

◆ getInitialCondition()

void CardiacProblem::getInitialCondition ( DHVecPtr  v) const
overridevirtual

Zero + asks each ionic model to fill the parts of the Vm vector with its initial value.

Reimplemented from AbstractTimedPdeProblem.

Definition at line 75 of file CardiacProblem.cpp.

◆ getIonicModels()

CepsVector< AbstractIonicModel * > CardiacProblem::getIonicModels ( ) const

Vector of all initd ionic models.

Definition at line 83 of file CardiacProblem.cpp.

◆ getSigmaE()

TensorField< GeomCell > * CardiacProblem::getSigmaE ( ) const

Link to extracellular conductivity.

Definition at line 107 of file CardiacProblem.cpp.

◆ getSigmaI()

TensorField< GeomCell > * CardiacProblem::getSigmaI ( ) const

Link to intracellular conductivity.

Definition at line 101 of file CardiacProblem.cpp.

◆ getTissueAttributes()

const CepsSet< CepsAttribute > & CardiacProblem::getTissueAttributes ( ) const

All attributes that localize tissue.

Definition at line 113 of file CardiacProblem.cpp.

◆ getTMVUnknowns()

virtual CepsVector<Unknown*> CardiacProblem::getTMVUnknowns ( ) const
pure virtual

Returns a vector containing all unknowns that are a TMV (especially useful for bilayer)

Implemented in MonodomainProblem, BilayerMonodomainProblem, and BidomainProblem.

◆ initializeAm()

void CardiacProblem::initializeAm ( )

Set the surface of membrane from input parameters.

Definition at line 214 of file CardiacProblem.cpp.

◆ initializeCm()

void CardiacProblem::initializeCm ( )

Sets the membrane conductivity from the input parameters.

Definition at line 184 of file CardiacProblem.cpp.

◆ initializeConductivities() [1/2]

void CardiacProblem::initializeConductivities ( )
virtual

Generates the functors that compute conductivity either from inputs or volume fraction.

Reimplemented in BilayerMonodomainProblem.

Definition at line 243 of file CardiacProblem.cpp.

◆ initializeConductivities() [2/2]

void CardiacProblem::initializeConductivities ( CepsString  sigmaIOpts,
CepsString  sigmaEOpts,
TensorField< GeomCell > *&  sigmaI,
TensorField< GeomCell > *&  sigmaE,
CepsString  fiberOptions,
CepsString  suffix = "" 
)
virtual

Generates the functors that compute conductivity either from inputs or volume fraction.

Definition at line 249 of file CardiacProblem.cpp.

◆ initializeEquation()

void CardiacProblem::initializeEquation ( )
overridevirtual

Initializes all the elements of the PDE from options.

Reimplemented from AbstractPdeProblem.

Definition at line 123 of file CardiacProblem.cpp.

◆ initializeIonicModels()

void CardiacProblem::initializeIonicModels ( )

Creates and assign ionic models to tissue regions from input string.

Definition at line 223 of file CardiacProblem.cpp.

◆ initializeStimulations()

void CardiacProblem::initializeStimulations ( )
virtual

Generates stimulations and links them to ionic models. Called within define source terms.

Definition at line 344 of file CardiacProblem.cpp.

◆ setupWithParameters()

void CardiacProblem::setupWithParameters ( InputParameters params)
overrideprotectedvirtual

Sets options from the parameters.

Ionic model is mandatory

Reimplemented from AbstractPdeProblem.

Reimplemented in ExtendedBidomainProblem.

Definition at line 141 of file CardiacProblem.cpp.

Field Documentation

◆ m_Am

ScalarField<DegreeOfFreedom>* CardiacProblem::m_Am
protected

Surface (cm2) of cell membrane per cm3 of myocardium.

Definition at line 220 of file CardiacProblem.hpp.

◆ m_AmOptions

CepsString CardiacProblem::m_AmOptions
protected

Options for membrane surface.

Definition at line 203 of file CardiacProblem.hpp.

◆ m_bcStimOptions

CepsString CardiacProblem::m_bcStimOptions
protected

Options for stimulation, on boundary.

Definition at line 212 of file CardiacProblem.hpp.

◆ m_Cm

ScalarField<DegreeOfFreedom>* CardiacProblem::m_Cm
protected

Membrane capacitance, may depend on x and t.

Definition at line 219 of file CardiacProblem.hpp.

◆ m_CmOptions

CepsString CardiacProblem::m_CmOptions
protected

Options for membrance capacitance.

Definition at line 202 of file CardiacProblem.hpp.

◆ m_fibersOptions

CepsString CardiacProblem::m_fibersOptions
protected

Options for fiber orientation.

Definition at line 205 of file CardiacProblem.hpp.

◆ m_ionicModels

CepsVector<AbstractIonicModel*> CardiacProblem::m_ionicModels
protected

All ionic models defined on the tissue.

Definition at line 222 of file CardiacProblem.hpp.

◆ m_ionOptions

CepsString CardiacProblem::m_ionOptions
protected

Options for ionic models.

Definition at line 204 of file CardiacProblem.hpp.

◆ m_sigmaE

TensorField<GeomCell>* CardiacProblem::m_sigmaE
protected

Extracellulat conductivity, defined on cells.

Definition at line 225 of file CardiacProblem.hpp.

◆ m_sigmaEOptions

CepsString CardiacProblem::m_sigmaEOptions
protected

Options for extracellulat conductivity.

Definition at line 207 of file CardiacProblem.hpp.

◆ m_sigmaI

TensorField<GeomCell>* CardiacProblem::m_sigmaI
protected

Intracellular conductivity, defined on cells.

Definition at line 224 of file CardiacProblem.hpp.

◆ m_sigmaIOptions

CepsString CardiacProblem::m_sigmaIOptions
protected

Options for intracellular conductivity.

Definition at line 206 of file CardiacProblem.hpp.

◆ m_stimOptions

CepsString CardiacProblem::m_stimOptions
protected

Options for stimulation.

Definition at line 211 of file CardiacProblem.hpp.

◆ m_tissueAttributes

CepsSet<CepsAttribute> CardiacProblem::m_tissueAttributes
protected

Identifier for the tissue region, default {-1}.

Definition at line 217 of file CardiacProblem.hpp.

◆ m_volFrac

ScalarField<GeomCell>* CardiacProblem::m_volFrac
protected

Fraction of tissue made of valid myocytes.

Definition at line 226 of file CardiacProblem.hpp.

◆ m_volFracItpFileE

CepsString CardiacProblem::m_volFracItpFileE
protected

Options for volume fraction.

Definition at line 210 of file CardiacProblem.hpp.

◆ m_volFracItpFileI

CepsString CardiacProblem::m_volFracItpFileI
protected

Options for volume fraction.

Definition at line 209 of file CardiacProblem.hpp.

◆ m_volFracOptions

CepsString CardiacProblem::m_volFracOptions
protected

Options for volume fraction.

Definition at line 208 of file CardiacProblem.hpp.


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