CEPS  24.01
Cardiac ElectroPhysiology Simulator
AbstractTimedPdeProblem.hpp
Go to the documentation of this file.
1 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2  This file is part of CEPS.
3 
4  CEPS is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  CEPS is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with CEPS (see file LICENSE at root of project).
16  If not, see <https://www.gnu.org/licenses/>.
17 
18 
19  Copyright 2019-2024 Inria, Universite de Bordeaux
20 
21  Authors, in alphabetical order:
22 
23  Pierre-Elliott BECUE, Florian CARO, Yves COUDIERE(*), Andjela DAVIDOVIC,
24  Charlie DOUANLA-LONTSI, Marc FUENTES, Mehdi JUHOOR, Michael LEGUEBE(*),
25  Pauline MIGERDITICHAN, Valentin PANNETIER(*), Nejib ZEMZEMI.
26  * : currently active authors
27 
28 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
31 #pragma once
32 
34 
37 {
38  public:
39 
43  explicit AbstractTimedPdeProblem(
44  Geometry* geom,
45  InputParameters* params = nullptr
46  );
47 
50  void
51  setupWithParameters(InputParameters* params) override;
52 
54  CepsReal
55  getStartTime() const override;
56 
58  CepsReal
59  getEndTime() const override;
60 
62  CepsReal
63  getTimeStep() const;
64 
66  void
67  setTimes(CepsReal tStart, CepsReal tEnd, CepsReal dt);
68 
70  CepsReal
71  getSnapshotTime() const override;
72 
74  void
76 
77  // ============================================
78 
81  virtual void
83 
85  virtual void
87 
90  void
91  initializeEquation() override;
92 
95  getErrors() const;
96 
98  CepsBool
100 
101  public:
102 
104  static constexpr CepsBool isStatic = false;
105 
106 
107  protected:
108 
113 
116 
119 
120 };
CepsArray< _Type, 2U > CepsArray2
C++ array, 2 elements.
Definition: CepsTypes.hpp:162
bool CepsBool
Booleans.
Definition: CepsTypes.hpp:124
float CepsReal
Need single precision floating point.
Definition: CepsTypes.hpp:100
std::shared_ptr< DistributedHaloVector > DHVecPtr
Typedef for pointer on Distributed Halo CepsVector.
Base class for creating PDEs to solve.
Astract Problem which does depend on time.
void setTimes(CepsReal tStart, CepsReal tEnd, CepsReal dt)
Define the start and end times, also time step.
CepsReal m_pdeTimeStep
Time Step for the PDE.
CepsArray2< CepsArray3< CepsArray3< CepsReal > > > getErrors() const
Get the errors.
virtual void getInitialCondition(DHVecPtr v) const
Build vector from function pointed by m_initialCondition.
CepsReal getTimeStep() const
pde time step
AbstractTimedPdeProblem(Geometry *geom, InputParameters *params=nullptr)
Constructor with geometry and optional parameters.
static constexpr CepsBool isStatic
Flag for static/timed.
CepsReal m_pdeStartTime
Initial time.
ScalarFunction * m_initialCondition
Function defining the initial condition, which is 0 if pointer is null.
void setupWithParameters(InputParameters *params) override
Set attributes from input file. Parameters are passed as arguments in case one wants to use other par...
void setSnapshotTime(CepsReal st)
Periodicity of outputs, in time units.
CepsReal getEndTime() const override
pde end time
void initializeEquation() override
Initializes equations (unknowns, bc, source term) and creates the spatial discretization This method ...
CepsReal getStartTime() const override
pde start time
CepsReal m_pdeSnapshotTime
Periodicity of outputs.
CepsBool canComputeErrorAtTime(CepsReal t) const
Tells if either analytic solution or reference solution has a snapshot at time t.
CepsReal getSnapshotTime() const override
Periodicity of outputs, in time units.
CepsArray2< CepsArray3< CepsArray3< CepsReal > > > m_errors
Will store Linf, L1 and L2 relative errors.
virtual void defineInitialCondition()
Sets the pointer on function for initial guess. Here it is set to nullptr, so it will be 0.
Encapsulates all the geometrical data.
Definition: Geometry.hpp:50
Reads and stores simulation configuration.
function caller : abstract base, only contains an variadic operator()