CEPS  24.01
Cardiac ElectroPhysiology Simulator
SourceTermManager.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"
35 
39 class SourceTermManager final: public CepsObject
40 {
41  public:
44 
50  explicit SourceTermManager(FunctionDictionary *dico);
51 
53  SourceTermManager(const SourceTermManager& that) = delete;
54 
57  operator=(const SourceTermManager& that) = delete;
58 
63  ~SourceTermManager() final;
64 
66  void
68 
75  void
76  add(const CepsString &params, CepsBool computeSupport = false);
77 
85  void
86  add(const CepsString &key, const CepsString &params, CepsBool computeSupport = false);
87 
96  void
97  add(const CepsString &key, CepsString &dicokey,
98  const CepsString &params, CepsBool computeSupport = false);
99 
108  void
109  add(
110  const CepsString& key,
111  const CepsString& params,
112  ScalarSAFunc* functor,
113  CepsBool computeSupport = false
114  );
115 
122  void
123  add(const CepsString& key, ScalarSourceTerm* sourceTerm);
124 
126  void
127  actualizeAll(CepsReal time);
128 
131  getSourceTerm(CepsString label) const;
132 
135  asVector() const;
136 
138  Manager* const
139  getManager() const;
140 
142  CepsUInt
144 
146  CepsUInt
147  getNbOfSourceTermsOf(CepsEnum flag) const;
148 
149  protected:
153 };
CepsSourceTermFlag
Source terms flags.
Definition: CepsEnums.hpp:163
std::basic_string< CepsChar > CepsString
C++ format string.
Definition: CepsTypes.hpp:128
std::map< _Key, _Tp, _Compare, _Alloc > CepsMap
C++ map.
Definition: CepsTypes.hpp:196
int CepsEnum
Enum type.
Definition: CepsTypes.hpp:216
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
Base class for other (big) CEPS classes. All classes can get a pointer to this base class and also co...
Definition: CepsObject.hpp:40
A degree of freedom for any kind of problem The dof can be associated to a geometrical element or not...
A class that manages data that is distributed between processors, not only real values (as in Distrib...
FunctionDictionary that holds functions which can be used to define source terms, boundary conditions...
A SAFunc is a ceps::Function that uses CepsStandardArgs as argument of call operator (),...
Definition: SAFunc.hpp:100
Source term manager to create and manage SourceTerm objects.
~SourceTermManager() final
Destroy the Source Term Manager object : default destructor.
SourceTermManager(const SourceTermManager &that)=delete
No copy constructor.
void actualizeAll(CepsReal time)
Actualize all data inside.
FunctionDictionary * m_dictionary
the dictionary
SourceTermManager(FunctionDictionary *dico)
Construct a new Source Term Manager object, linked with dictionary of functions.
DistributedInfos< DegreeOfFreedom * > * m_dofs
dofs
Manager * m_manager
the manager
void add(const CepsString &params, CepsBool computeSupport=false)
Add a source term from parameters.
void setDofsInfos(DistributedInfos< DegreeOfFreedom * > *dofs)
Set dofs infos in this class.
CepsMap< CepsString, ScalarSourceTerm * > Manager
Alias for manager inside.
Manager *const getManager() const
Get a map of all source terms.
ScalarSourceTerm * getSourceTerm(CepsString label) const
Get a source term, nullptr if not found.
CepsUInt getNbOfSourceTermsOf(CepsSourceTermFlag flag) const
Number of registered source terms of type flag.
CepsVector< ScalarSourceTerm * > asVector() const
Get a vector of all source terms.
SourceTermManager & operator=(const SourceTermManager &that)=delete
No assignement operator.
Source term, essentially a ScalarField.
Definition: SourceTerm.hpp:50