CEPS  24.01
Cardiac ElectroPhysiology Simulator
ActivationTracker.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 
32 #include "common/CepsCommon.hpp"
33 
35 // #include "pde/common/writers/MeditSolutionWriter.hpp"
37 
39 #include "geometry/Geometry.hpp"
40 
41 class CardiacSolver;
42 class CardiacProblem;
43 
60 {
61  public:
62 
67 
70 
72  void update(
73  CepsInt iter,
74  CepsReal time,
75  DHVecPtr solution,
76  DHVecPtr prevSolution
77  );
78 
80  void writeActivationMap();
81 
84 
87 
90 
94 
95 
96  protected:
97 
99  void
101 
103  void
105 
107  CepsBool
109 
110 
111  protected:
112 
116 
118 
120  static constexpr CepsUInt _threshold = 0;
121  static constexpr CepsUInt _apdpctg = 1;
122  static constexpr CepsUInt _minV4Peak = 2;
123 
130 
136 
139 
141 
142 };
std::basic_string< CepsChar > CepsString
C++ format string.
Definition: CepsTypes.hpp:128
CepsIndex CepsUnknownIndex
For unknowns.
Definition: CepsTypes.hpp:217
std::map< _Key, _Tp, _Compare, _Alloc > CepsMap
C++ map.
Definition: CepsTypes.hpp:196
std::set< _Type, _Compare, _Alloc > CepsSet
C++ set.
Definition: CepsTypes.hpp:209
std::vector< _Type, _Alloc > CepsVector
C++ vector.
Definition: CepsTypes.hpp:155
bool CepsBool
Booleans.
Definition: CepsTypes.hpp:124
std::make_unsigned_t< CepsInt > CepsUInt
Unsigned version on CepsInt.
Definition: CepsTypes.hpp:109
float CepsReal
Need single precision floating point.
Definition: CepsTypes.hpp:100
int32_t CepsInt
Need 32 bit integer.
Definition: CepsTypes.hpp:106
std::shared_ptr< DistributedHaloVector > DHVecPtr
Typedef for pointer on Distributed Halo CepsVector.
Class managing computations from potential to outputs.
CepsBool allPointsHaveBeenActivated() const
Tells if all points have seen AP start (checked with activation threshold)
CardiacProblem * m_problem
Link to problem structure.
DHVecPtr m_activationTimes
Values of activation times at each point.
void writeActivationMap()
Writes activation times and probe points data.
CepsMap< CepsUnknownIndex, CepsSet< CepsDofGlobalIndex > > m_foundAPD
Flag map.
static constexpr CepsUInt _apdpctg
Index in activation data.
TimeWriter * m_timeWriter
Link to the solver's time writer, if needed...
~ActivationTracker()
Destructor.
DHVecPtr m_APD
length of AP (?)
CepsString getByeByeMessage() const
Message to be displayed at the end of computation.
DHVecPtr m_peakTimes
Times of max potential.
void update(CepsInt iter, CepsReal time, DHVecPtr solution, DHVecPtr prevSolution)
Writes the solution (optionnally currents) every m_nbIterSnapshot steps only. Also updates activation...
DHVecPtr m_APD50
length of AP to get to 50% depol
CepsMap< CepsUnknownIndex, CepsSet< CepsDofGlobalIndex > > m_foundPeak
Flag map.
void setupWithParameters(InputParameters *params)
Initializes attributes from text input.
Geometry * m_geom
Geometry.
ActivationTracker(CardiacSolver *solver)
Constructor.
CepsMap< CepsUnknownIndex, CepsSet< CepsDofGlobalIndex > > m_activationSeen
Flag map.
static constexpr CepsUInt _threshold
Index in activation data.
CepsUInt m_nbIterPostProcess
Output periodicity.
CepsMap< CepsUnknownIndex, CepsSet< CepsDofGlobalIndex > > m_activationNotYetSeen
Flag map.
DHVecPtr m_peakValues
Value of max potential.
CepsMap< CepsUnknownIndex, CepsSet< CepsDofGlobalIndex > > m_foundAPD50
Flag map.
CepsMap< CepsUnknownIndex, CepsReal3D > m_activationTimeData
AP analysis.
CepsUInt m_nToBeSeen
Number of dofs in tissue for each activation time data.
CepsReal m_tissueVolume
Reference volume.
DHVecPtr m_activated
1/0 status of point (above/below threshold)
static constexpr CepsUInt _minV4Peak
Index in activation data.
CepsBool allPointsHaveBeenRepolarized() const
Tells if all points have seen AP end (checked with APD percentage)
void initializeActivationMap()
Allocates arrays for activation detection.
CepsVector< CepsReal > m_activatedVolume
Size of tissue that is above activation threshold.
CepsVector< CepsReal > & getActivatedVolume()
Returns reference to data, so it can be linked to a TimeWriter.
CepsBool allSeen(const CepsMap< CepsUnknownIndex, CepsSet< CepsDofGlobalIndex >> &) const
Check not nans for given array.
A abstract class that regroups common parameters of cardiac problems.
Solves cardiac problems, that all share the same structure.
Base class for other (big) CEPS classes. All classes can get a pointer to this base class and also co...
Definition: CepsObject.hpp:40
Encapsulates all the geometrical data.
Definition: Geometry.hpp:50
Reads and stores simulation configuration.