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