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