CEPS  24.01
Cardiac ElectroPhysiology Simulator
CardiacSolver.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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
30 #pragma once
31 
37 
53 class CardiacSolver : public HeatSolver
54 {
55 
56  public:
57 
59  virtual ~CardiacSolver();
60 
62  CardiacSolver(CardiacProblem* problem);
63 
65  void
66  solve() override;
67 
69  CepsString
71 
74  getCardiacProblem() const;
75 
78  getActivationTracker() const;
79 
80  protected:
81 
83  void
84  assembleAndSolve() override;
85 
87  CepsBool
88  finished() const override;
89 
90  // --------------------====
91  // LHS computation
92 
93  // /// @brief Computes the stiffness matrix including conductivity
94  // void computeCardiacStiffnessMatrix();
95 
96  // /// @brief Computes the stiffness matrix including conductivity
97  // void computeCardiacStiffnessMatrixForSources();
98 
99  // --------------------====
100  // RHS compute and solve
101 
105  void fillSourceTermsVector(CepsReal tn) override;
106 
107  // /// @brief Updates matrix and RHS for RK numerical schemes (actually performs all RK substeps)
108  // void updateAndSolveRK();
109 
110  // -------------------------==
111  // I/O
112 
114  void output(DHVecPtr dummy, CepsBool immediatWriting = true) override;
115 
116 
117  protected:
118 
119  // Shorcuts
121 
122  // Ionic solvers
125 
126  // Output stuff
130  std::set<CepsUInt> m_saveDepolarizationTime;
131 
132  // Run control
135 
136 };
137 
138 
std::basic_string< CepsChar > CepsString
C++ format string.
Definition: CepsTypes.hpp:128
std::vector< _Type, _Alloc > CepsVector
C++ vector.
Definition: CepsTypes.hpp:155
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.
Class managing computations from potential to outputs.
A abstract class that regroups common parameters of cardiac problems.
Solves cardiac problems, that all share the same structure.
CepsBool m_stopAtCompleteActivation
stop when all points have activation time computed
ActivationTracker * getActivationTracker() const
Link to activation tracker.
void output(DHVecPtr dummy, CepsBool immediatWriting=true) override
Calls the appropriate post-processing and writing methods.
CepsReal m_postProcessPeriod
Period of post process calculations.
CepsBool m_stopAtCompleteRepolarization
stop when all points have APD computed
void assembleAndSolve() override
Performs one iteration of the solver.
CepsBool m_writeIapp
Flag for additional output.
CardiacProblem * getCardiacProblem() const
Converts own pointer to abstract pde problem to cardiac problem.
void fillSourceTermsVector(CepsReal tn) override
Computes all contributions to source terms (ionic current, stimcurrent, field sources) with a loop on...
virtual ~CardiacSolver()
Destructor.
CepsVector< IonicSolver * > m_ionSolvers
One solver per ionic model in the problem.
void solve() override
Performs all iterations of the PDE solver.
CepsString getResultsLocationMessage() const
To be displayed at the end of computation.
std::set< CepsUInt > m_saveDepolarizationTime
Components of which to save depolarization times.
CepsBool m_writeIIon
Flag for additional output.
CardiacSolver(CardiacProblem *problem)
Constructor with associated PDE problem.
CepsString m_ionSolvOpts
Options for ionic ODE solvers.
ActivationTracker * m_activationTracker
Output computation and writing.
CepsBool finished() const override
Tells if simulation reached end time or, if enabled, all points have seen an AP.
Solve heat equation.
Definition: HeatSolver.hpp:39