CEPS  24.01
Cardiac ElectroPhysiology Simulator
Unknown.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 
34 class Unknown;
35 
45 {
46  public:
48  Unknown () = delete;
49 
51  explicit Unknown(
52  const CepsUnknownIndex& identifier,
53  const CepsString& name = CepsString(CepsNoName),
54  const CepsString& unit = CepsString(CepsNoUnit));
55 
57  Unknown(const Unknown&that);
58 
60  Unknown&
61  operator=(const Unknown& that);
62 
65  getIdentifier() const;
66 
67  // WARNING: no set identifer because the name must be constant along the exec..
68 
70  const CepsString&
71  getName() const;
72 
74  void
75  setName(const CepsString& name);
76 
78  const CepsString&
79  getUnit() const;
80 
82  void
83  setUnit(const CepsString& unit);
84 
86  const CepsLocationFlag&
87  getLocation() const;
88 
91  const CepsSet<Unknown*>&
93 
95  CepsBool
96  isOnLocation(const CepsLocationFlag& flag) const;
97 
99  void
100  setLocation(const CepsLocationFlag& location);
101 
103  CepsBool
104  isSpatial() const;
105 
107  void
108  addUnknownInteraction(Unknown* u, CepsBool addReciprocal = true);
109 
111  CepsBool
112  interactsWith(Unknown* u) const;
113 
114  protected:
115 
121 
122 };
123 
125 void
127 
130 {
131 
132  public:
133 
136 
137 };
138 
CepsLocationFlag
DataLocation: an enum that will be used by various elements of the code (pde, readers,...
Definition: CepsEnums.hpp:108
std::basic_string< CepsChar > CepsString
C++ format string.
Definition: CepsTypes.hpp:128
CepsIndex CepsUnknownIndex
For unknowns.
Definition: CepsTypes.hpp:217
constexpr const CepsChar CepsNoName[]
Default string for things without defined name.
Definition: CepsTypes.hpp:229
std::set< _Type, _Compare, _Alloc > CepsSet
C++ set.
Definition: CepsTypes.hpp:209
bool CepsBool
Booleans.
Definition: CepsTypes.hpp:124
constexpr const CepsChar CepsNoUnit[]
Default string for things without defined unit.
Definition: CepsTypes.hpp:230
void getRegionsIntersectionWith(Unknown const *a, Unknown const *b, CepsSet< CepsAttribute > *regions)
Extracts the regions on which both unknowns are defined.
Data describing how two unknowns are coupled.
Definition: Unknown.hpp:130
Unknown * u2
Second unknown in the coupling.
Definition: Unknown.hpp:135
Unknown * u1
First unknown in the coupling.
Definition: Unknown.hpp:134
A class used to defined an unknown of a PDE problem The unknown can be defined on a specific region,...
Definition: Unknown.hpp:45
CepsBool interactsWith(Unknown *u) const
Tells if unknowns interacts with another, true if self.
Definition: Unknown.cpp:137
const CepsSet< Unknown * > & getUnknownsInInteraction() const
Get the set of unknowns with whom there are interactions.
Definition: Unknown.cpp:143
Unknown & operator=(const Unknown &that)
Copy assignement.
Definition: Unknown.cpp:55
const CepsLocationFlag & getLocation() const
Get the data location of the unknown.
Definition: Unknown.cpp:101
CepsBool isOnLocation(const CepsLocationFlag &flag) const
Detect if the unknown is appliable on this location.
Definition: Unknown.cpp:107
void setUnit(const CepsString &unit)
Set the unit of the unknown.
Definition: Unknown.cpp:94
CepsString m_unit
Unit of the unknown.
Definition: Unknown.hpp:118
void setName(const CepsString &name)
Get the name of the unknown.
Definition: Unknown.cpp:75
CepsString m_name
Name of the unknown.
Definition: Unknown.hpp:117
void addUnknownInteraction(Unknown *u, CepsBool addReciprocal=true)
Add an unknown this one interacts with.
Definition: Unknown.cpp:126
CepsLocationFlag m_location
Unknown location.
Definition: Unknown.hpp:119
const CepsString & getName() const
Get the name of the unknown.
Definition: Unknown.cpp:69
Unknown()=delete
Default constructor.
CepsBool isSpatial() const
Tells if unknown is defined on geometrical elements.
Definition: Unknown.cpp:120
void setLocation(const CepsLocationFlag &location)
Set the data location of the unknown.
Definition: Unknown.cpp:113
const CepsString & getUnit() const
Get the unit of the unknown.
Definition: Unknown.cpp:88
CepsUnknownIndex getIdentifier() const
Get the identifier of the unknown.
Definition: Unknown.cpp:82
CepsUnknownIndex m_identifier
Identifier.
Definition: Unknown.hpp:116
CepsSet< Unknown * > m_interactsWith
Other unknowns in interaction.
Definition: Unknown.hpp:120
An abstract class from which all objects that contain region attributes should derive.