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