OpenMEEG
Toggle main menu visibility
Loading...
Searching...
No Matches
OpenMEEG
include
domain.h
Go to the documentation of this file.
1
// Project Name: OpenMEEG (http://openmeeg.github.io)
2
// © INRIA and ENPC under the French open source license CeCILL-B.
3
// See full copyright notice in the file LICENSE.txt
4
// If you make a copy of this file, you must either:
5
// - provide also LICENSE.txt and modify this header to refer to it.
6
// - replace this header by the LICENSE.txt content.
7
8
#pragma once
9
16
17
#include <string>
18
#include <
interface.h
>
19
20
namespace
OpenMEEG
{
21
26
27
class
SimpleDomain
{
28
public
:
29
30
typedef
enum
{
Inside
,
Outside
}
Side
;
31
32
SimpleDomain
() { }
33
SimpleDomain
(
Interface
& i,
const
Side
s): interf(i),side(s) { }
34
~SimpleDomain
() { }
35
36
Interface
&
interface
() {
return
interf; }
37
const
Interface
&
interface
()
const
{
return
interf; }
38
39
bool
inside
()
const
{
return
(side==
Inside
); }
40
41
// omesh must belong to the interface.
42
43
int
mesh_orientation
(
const
OrientedMesh
& omesh)
const
{
44
return
(
inside
()) ? omesh.
orientation
() : -omesh.
orientation
();
45
}
46
47
private
:
48
49
Interface
interf;
50
Side
side;
51
};
52
56
57
class
OPENMEEG_EXPORT
Domain
{
58
public
:
59
60
typedef
std::vector<SimpleDomain>
Boundaries
;
61
62
Domain
(
const
std::string& dname=
""
): domain_name(dname) { }
63
~Domain
() { }
64
66
67
Boundaries
&
boundaries
() {
return
bounds; }
68
const
Boundaries
&
boundaries
()
const
{
return
bounds; }
69
71
72
std::string&
name
() {
return
domain_name; }
73
const
std::string&
name
()
const
{
return
domain_name; }
74
76
77
void
set_conductivity
(
const
double
c) { cond = c; }
78
bool
has_conductivity
()
const
{
return
cond != -1.0; }
79
const
double
&
conductivity
()
const
{
return
cond; }
80
84
85
void
info
(
const
bool
outermost=
false
)
const
;
86
87
bool
contains
(
const
Mesh
& m)
const
{
return
mesh_orientation
(m)!=0; }
88
89
bool
contains
(
const
Vect3
& point)
const
;
90
94
95
int
mesh_orientation
(
const
Mesh
& m)
const
{
96
for
(
const
auto
& boundary :
boundaries
())
97
for
(
const
auto
& omesh : boundary.interface().oriented_meshes())
98
if
(&omesh.mesh()==&m)
99
return
boundary.mesh_orientation(omesh);
100
return
0;
101
}
102
103
private
:
104
105
Boundaries bounds;
106
std::string domain_name =
""
;
107
double
cond = -1.0;
108
};
109
111
112
typedef
std::vector<Domain>
Domains
;
113
}
OpenMEEG::Domain::boundaries
const Boundaries & boundaries() const
Definition
domain.h:68
OpenMEEG::Domain::mesh_orientation
int mesh_orientation(const Mesh &m) const
Definition
domain.h:95
OpenMEEG::Domain::name
std::string & name()
The name of the domain.
Definition
domain.h:72
OpenMEEG::Domain::boundaries
Boundaries & boundaries()
Boundaries of the domain.
Definition
domain.h:67
OpenMEEG::Domain::name
const std::string & name() const
Definition
domain.h:73
OpenMEEG::Domain::Domain
Domain(const std::string &dname="")
Definition
domain.h:62
OpenMEEG::Domain::has_conductivity
bool has_conductivity() const
Definition
domain.h:78
OpenMEEG::Domain::Boundaries
std::vector< SimpleDomain > Boundaries
Definition
domain.h:60
OpenMEEG::Domain::info
void info(const bool outermost=false) const
Print information about the domain.
OpenMEEG::Domain::contains
bool contains(const Mesh &m) const
Definition
domain.h:87
OpenMEEG::Domain::set_conductivity
void set_conductivity(const double c)
The conductivity of the domain.
Definition
domain.h:77
OpenMEEG::Domain::~Domain
~Domain()
Definition
domain.h:63
OpenMEEG::Domain::contains
bool contains(const Vect3 &point) const
Does this point belongs to the domain ?
OpenMEEG::Domain::conductivity
const double & conductivity() const
Definition
domain.h:79
OpenMEEG::Interface
Interface class An interface is a closed-shape composed of oriented meshes (vector of oriented meshes...
Definition
interface.h:49
OpenMEEG::Mesh
Definition
mesh.h:34
OpenMEEG::OrientedMesh
An Oriented Mesh is a mesh associated with a boolean stating if it is well oriented.
Definition
interface.h:24
OpenMEEG::OrientedMesh::orientation
int orientation() const
orientation is +1 or -1 ?
Definition
interface.h:36
OpenMEEG::SimpleDomain::SimpleDomain
SimpleDomain(Interface &i, const Side s)
Definition
domain.h:33
OpenMEEG::SimpleDomain::interface
const Interface & interface() const
Definition
domain.h:37
OpenMEEG::SimpleDomain::inside
bool inside() const
Definition
domain.h:39
OpenMEEG::SimpleDomain::mesh_orientation
int mesh_orientation(const OrientedMesh &omesh) const
Definition
domain.h:43
OpenMEEG::SimpleDomain::Side
Side
Definition
domain.h:30
OpenMEEG::SimpleDomain::Inside
@ Inside
Definition
domain.h:30
OpenMEEG::SimpleDomain::Outside
@ Outside
Definition
domain.h:30
OpenMEEG::SimpleDomain::interface
Interface & interface()
Definition
domain.h:36
OpenMEEG::SimpleDomain::~SimpleDomain
~SimpleDomain()
Definition
domain.h:34
OpenMEEG::SimpleDomain::SimpleDomain
SimpleDomain()
Definition
domain.h:32
OpenMEEG::Vect3
Vect3.
Definition
vect3.h:28
interface.h
OpenMEEG
Definition
analytics.h:14
OpenMEEG::Domains
std::vector< Domain > Domains
A vector of Domain is called Domains.
Definition
domain.h:112
Generated by
1.17.0