chombo-discharge
Loading...
Searching...
No Matches
CD_EBGeometryIFImplem.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_EBGEOMETRYIFIMPLEM_H
14#define CD_EBGEOMETRYIFIMPLEM_H
15
16#include <CD_EBGeometryIF.H>
17#include <CD_NamespaceHeader.H>
18
19template <typename T>
21{
22 this->m_sdf = nullptr;
23 this->m_flipInside = false;
24 this->m_zCoord = 0.0;
25}
26
27template <typename T>
28EBGeometryIF<T>::EBGeometryIF(const std::shared_ptr<EBGeometry::ImplicitFunction<T>>& a_sdf,
29 const bool a_flipInside,
30 const Real a_zCoord)
31
32{
33 this->m_sdf = a_sdf;
34 this->m_flipInside = a_flipInside;
35 this->m_zCoord = a_zCoord;
36}
37
38template <typename T>
40{
41 this->m_sdf = a_inputIF.m_sdf;
42 this->m_flipInside = a_inputIF.m_flipInside;
43 this->m_zCoord = a_inputIF.m_zCoord;
44}
45
46template <typename T>
48{
49 m_sdf = nullptr;
50}
51
52template <typename T>
53Real
55{
56#if CH_SPACEDIM == 2
57 EBGeometry::Vec3T<T> p(a_point[0], a_point[1], m_zCoord);
58#else
59 EBGeometry::Vec3T<T> p(a_point[0], a_point[1], a_point[2]);
60#endif
61
62 Real ret = Real(m_sdf->value(p));
63
64 if (m_flipInside) {
65 ret = -ret;
66 }
67
68 return ret;
69}
70
71template <typename T>
72BaseIF*
74{
75 return (BaseIF*)(new EBGeometryIF(*this));
76}
77
78#include <CD_NamespaceFooter.H>
79
80#endif
Binding of EBGeometry signed distance functions to Chombo objects.
Shallow binding of EBGeometry signed distance functions to Chombo.
Definition CD_EBGeometryIF.H:36
virtual ~EBGeometryIF()
Destructor. Does nothing.
Definition CD_EBGeometryIFImplem.H:47
EBGeometryIF()
Constructor. Sets shape to nullptr.
Definition CD_EBGeometryIFImplem.H:20
virtual BaseIF * newImplicitFunction() const override
IF factory method.
Definition CD_EBGeometryIFImplem.H:73
virtual Real value(const RealVect &a_point) const override
Value function. Returns distance to object.
Definition CD_EBGeometryIFImplem.H:54
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