chombo-discharge
CD_SphereArray.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_SphereArray_H
13 #define CD_SphereArray_H
14 
15 // Chombo includes
16 #include <BaseIF.H>
17 
18 // Our includes
19 #include <EBGeometry.hpp>
20 #include <CD_NamespaceHeader.H>
21 
22 using AABB = EBGeometry::BoundingVolumes::AABBT<Real>;
23 using Vec3 = EBGeometry::Vec3T<Real>;
24 using SDF = EBGeometry::SignedDistanceFunction<Real>;
25 using Sphere = EBGeometry::SphereSDF<Real>;
26 
30 class SphereArray : public BaseIF
31 {
32 public:
36  SphereArray() = delete;
37 
48  SphereArray(const Real a_radius,
49  const RealVect a_loCenter,
50  const RealVect a_sphereGap,
51  const IntVect a_numSpheres,
52  const bool a_useFast,
53  const bool a_flipInside,
54  const Real a_zCoord = 0.0);
55 
59  SphereArray(const SphereArray& a_inputIF);
60 
64  virtual ~SphereArray();
65 
70  virtual Real
71  value(const RealVect& a_point) const override;
72 
76  virtual BaseIF*
77  newImplicitFunction() const override;
78 
79 protected:
83  static constexpr size_t K = 4;
84 
88  bool m_useFast;
89 
94 
98  std::shared_ptr<EBGeometry::ImplicitFunction<Real>> m_slowUnion;
99 
103  std::shared_ptr<EBGeometry::ImplicitFunction<Real>> m_fastUnion;
104 };
105 
106 #include <CD_NamespaceFooter.H>
107 
108 #endif
A Cartesian array of spheres.
Definition: CD_SphereArray.H:31
bool m_flipInside
Make inside to outside.
Definition: CD_SphereArray.H:93
virtual Real value(const RealVect &a_point) const override
Value function.
Definition: CD_SphereArray.cpp:88
std::shared_ptr< EBGeometry::ImplicitFunction< Real > > m_fastUnion
Union that uses bounding volume hierarchy acceleration.
Definition: CD_SphereArray.H:103
virtual ~SphereArray()
Destructor (does nothing)
Definition: CD_SphereArray.cpp:82
SphereArray()=delete
Disallowed (for now)
std::shared_ptr< EBGeometry::ImplicitFunction< Real > > m_slowUnion
Standard union ala Chombo.
Definition: CD_SphereArray.H:98
bool m_useFast
Switch for using fast or slow union.
Definition: CD_SphereArray.H:88
virtual BaseIF * newImplicitFunction() const override
Factory method – calls the copy constructor.
Definition: CD_SphereArray.cpp:115
static constexpr size_t K
Tree degree for BVH accelerator.
Definition: CD_SphereArray.H:83