chombo-discharge
Loading...
Searching...
No Matches
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
17#include <CD_NamespaceHeader.H>
18
19template <class T>
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
29template <class T>
31{
32 m_mesh = a_object.m_mesh;
33 m_zCoord = a_object.m_zCoord;
34 m_flipInside = a_object.m_flipInside;
35}
36
37template <class T>
40
41template <class T>
42Real
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
62template <class T>
63BaseIF*
65{
66 return static_cast<BaseIF*>(new SignedDistanceDCEL(*this));
67}
68
69#include <CD_NamespaceFooter.H>
70
71#endif
Declaration of an implicit-function class that gets its value function from a DCEL surface Tesselatio...
Signed distance function from a DCEL mesh.
Definition CD_SignedDistanceDCEL.H:34
~SignedDistanceDCEL()
Destructor (does nothing)
Definition CD_SignedDistanceDCELImplem.H:38
Real value(const RealVect &a_point) const override
Value function.
Definition CD_SignedDistanceDCELImplem.H:43
SignedDistanceDCEL()=delete
Disallowed, use the full constructor.
BaseIF * newImplicitFunction() const override
Factory method.
Definition CD_SignedDistanceDCELImplem.H:64
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:37
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:25