CEPS  24.01
Cardiac ElectroPhysiology Simulator
BoundaryConditionManager.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 
43 {
44  public:
48  using Func = ScalarSAFunc;
56 
59 
62  operator=(const BoundaryConditionManager& that) = delete;
63 
69 
71  void
73 
79  void
80  add(const CepsString& params);
81 
88  void
89  add(const CepsString& key, const CepsString& params);
90 
98  void
99  add(const CepsString& key, const CepsBoundaryConditionFlag& type, const CepsString& params);
100 
109  void
110  add(
111  const CepsString& key,
112  const CepsBoundaryConditionFlag& type,
113  const CepsString& params,
114  ScalarSAFunc* functor
115  );
116 
123  void
124  add(const CepsString& key, ScalarBoundaryCondition* boundaryCondition);
125 
126  // -------------------------------------------------- //
127  // get managers inside
128  // -------------------------------------------------- //
129 
139  getBC(CepsString key, const CepsBoundaryConditionFlag& type) const;
140 
147  Manager*
148  getBCs(const CepsBoundaryConditionFlag& type) const;
149 
151  Manager*
152  getDirichletBCs() const;
153 
155  Manager*
156  getNeumannBCs() const;
157 
159  Manager*
160  getRobinBCs() const;
161 
162  // -------------------------------------------------- //
163  // reset
164  // -------------------------------------------------- //
165 
167  virtual void
168  reset();
169 
170  // -------------------------------------------------- //
171  // actualize
172  // -------------------------------------------------- //
173 
175  void
176  actualizeAll(CepsReal time);
177 
179  void
181 
183  void
185 
187  void
189 
190  // -------------------------------------------------- //
191  // print
192  // -------------------------------------------------- //
193 
195  friend std::ostream &
196  operator<<(std::ostream &os, const BoundaryConditionManager &manager);
197 
198  protected:
205 
206 };
CepsBoundaryConditionFlag
Enumeration for boundary condition type.
Definition: CepsEnums.hpp:155
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
std::set< _Type, _Compare, _Alloc > CepsSet
C++ set.
Definition: CepsTypes.hpp:209
float CepsReal
Need single precision floating point.
Definition: CepsTypes.hpp:100
SAFunc< CepsMathScalar > ScalarSAFunc
TypeDef for functions that return a scalar.
Definition: SAFunc.hpp:134
Boundary condition to manage Dirichlet, Neumann and Robin conditions.
void setDofsInfos(DistributedInfos< DegreeOfFreedom * > *dof)
Set dofs infos in this class.
BoundaryConditionManager(const BoundaryConditionManager &that)=delete
No copy constructor.
Manager * m_dirichlet
managers for dirichlet
void actualizeAllRobin(CepsReal time)
Actualize only Robin conditions.
CepsMap< CepsString, ScalarBoundaryCondition * > Manager
Alias for manager inside.
void actualizeAllDirichlet(CepsReal time)
Actualize only Dirichlet conditions.
Manager * getRobinBCs() const
Get the manager for Robin conditions of dim.
Manager * m_neumann
managers for neumann
void add(const CepsString &params)
Add a boundary condition term from parameters.
~BoundaryConditionManager() final
Destroy the Boundary Condition Manager object : default destructor.
Manager * m_robin
managers for robin
Manager * getNeumannBCs() const
Get the manager for Neumann conditions of dim.
void actualizeAll(CepsReal time)
Actualize all bc.
BoundaryConditionManager & operator=(const BoundaryConditionManager &that)=delete
No assignment operator.
FunctionDictionary * m_dictionary
link to the dictionary
virtual void reset()
Reset the boundary conditions manager.
void actualizeAllNeumann(CepsReal time)
Actualize only Neumann conditions.
CepsSet< DegreeOfFreedom * > m_rowsAlreadyUsed
rows that have a BC
ScalarBoundaryCondition * getBC(CepsString key, const CepsBoundaryConditionFlag &type) const
Get the boundary condition with name 'key' of type 'type' on dimension 'dim'.
DistributedInfos< DegreeOfFreedom * > * m_dofs
dofs
Manager * getBCs(const CepsBoundaryConditionFlag &type) const
Get th correct manager for bc.
Manager * getDirichletBCs() const
Get the manager for Dirichlet conditions.
BoundaryConditionManager(FunctionDictionary *dico)
Construct a new Boundary Condition Manager object dimension.
Boundary condition.
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
Abstract class for objects that have a dimensionality (0D to 3D)