chombo-discharge
Loading...
Searching...
No Matches
Source
ImplicitFunctions
CD_SignedDistanceDCELImplem.H
Go to the documentation of this file.
1
/* chombo-discharge
2
* Copyright © 2021 SINTEF Energy Research.
3
* Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4
*/
5
12
#ifndef CD_SignedDistanceDCELImplem_H
13
#define CD_SignedDistanceDCELImplem_H
14
15
// Our includes
16
#include <
CD_SignedDistanceDCEL.H
>
17
#include <CD_NamespaceHeader.H>
18
19
template
<
class
T>
20
SignedDistanceDCEL<T>::SignedDistanceDCEL
(
const
std::shared_ptr<Mesh>
&
a_mesh
,
21
const
bool
a_flipInside
,
22
const
Real
a_zCoord
)
23
{
24
m_mesh =
a_mesh
;
25
m_zCoord =
a_zCoord
;
26
m_flipInside =
a_flipInside
;
27
}
28
29
template
<
class
T>
30
SignedDistanceDCEL<T>::SignedDistanceDCEL
(
const
SignedDistanceDCEL
&
a_object
)
31
{
32
m_mesh =
a_object
.m_mesh;
33
m_zCoord =
a_object
.m_zCoord;
34
m_flipInside =
a_object
.m_flipInside;
35
}
36
37
template
<
class
T>
38
SignedDistanceDCEL<T>::~SignedDistanceDCEL
()
39
{}
40
41
template
<
class
T>
42
Real
43
SignedDistanceDCEL<T>::value
(
const
RealVect
&
a_point
)
const
44
{
45
46
#if CH_SPACEDIM == 2
47
EBGeometry::Vec3T<T> p(
a_point
[0],
a_point
[1], m_zCoord);
48
#else
49
EBGeometry::Vec3T<T> p(
a_point
[0],
a_point
[1],
a_point
[2]);
50
#endif
51
52
T
retval
= m_mesh->signedDistance(
53
p);
// Note that Dcel::mesh can return either positive or negative for outside, depending on the orientation of the input normals.
54
55
if
(m_flipInside) {
56
retval
= -
retval
;
57
}
58
59
return
Real
(
retval
);
60
}
61
62
template
<
class
T>
63
BaseIF*
64
SignedDistanceDCEL<T>::newImplicitFunction
()
const
65
{
66
return
static_cast<
BaseIF*
>
(
new
SignedDistanceDCEL
(*
this
));
67
}
68
69
#include <CD_NamespaceFooter.H>
70
71
#endif
CD_SignedDistanceDCEL.H
Declaration of an implicit-function class that gets its value function from a DCEL surface Tesselatio...
SignedDistanceDCEL
Signed distance function from a DCEL mesh.
Definition
CD_SignedDistanceDCEL.H:34
SignedDistanceDCEL::~SignedDistanceDCEL
~SignedDistanceDCEL()
Destructor (does nothing)
Definition
CD_SignedDistanceDCELImplem.H:38
SignedDistanceDCEL::value
Real value(const RealVect &a_point) const override
Value function.
Definition
CD_SignedDistanceDCELImplem.H:43
SignedDistanceDCEL::SignedDistanceDCEL
SignedDistanceDCEL()=delete
Disallowed, use the full constructor.
SignedDistanceDCEL::newImplicitFunction
BaseIF * newImplicitFunction() const override
Factory method.
Definition
CD_SignedDistanceDCELImplem.H:64
TracerParticleSolver
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition
CD_TracerParticleSolver.H:37
TracerParticleSolver::TracerParticleSolver
TracerParticleSolver()
Default constructor.
Definition
CD_TracerParticleSolverImplem.H:25
Generated by
1.9.8