chombo-discharge
CD_PerlinSphereSdf.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_PerlinSphereSdf_H
13 #define CD_PerlinSphereSdf_H
14 
15 // Chombo includes
16 #include <BaseIF.H>
17 #include <SphereIF.H>
18 
19 // Our includes
20 #include <CD_PerlinSdf.H>
21 #include <CD_NamespaceHeader.H>
22 
26 class PerlinSphereSdf : public BaseIF
27 {
28 public:
33  {}
34 
47  PerlinSphereSdf(const Real& a_rad,
48  const RealVect& a_center,
49  const bool& a_inside,
50  const Real& a_noiseAmp,
51  const RealVect& a_noiseFreq,
52  const Real& a_persistence,
53  const int& a_octaves,
54  const bool& a_reseed = false);
55 
60  PerlinSphereSdf(const PerlinSphereSdf& a_inputIF);
61 
65  virtual ~PerlinSphereSdf();
66 
71  virtual Real
72  value(const RealVect& a_pos) const;
73 
77  virtual BaseIF*
78  newImplicitFunction() const;
79 
80 protected:
84  Real m_rad;
85 
89  RealVect m_center;
90 
94  bool m_inside;
95 
99  RefCountedPtr<BaseIF> m_perlinIF;
100 };
101 
102 #include <CD_NamespaceFooter.H>
103 
104 #endif
Declaration of signed distance Perlin noise.
Noisy sphere geometry (with Perlin noise).
Definition: CD_PerlinSphereSdf.H:27
RefCountedPtr< BaseIF > m_perlinIF
Noise function.
Definition: CD_PerlinSphereSdf.H:99
Real m_rad
Radius.
Definition: CD_PerlinSphereSdf.H:84
virtual Real value(const RealVect &a_pos) const
Value function. Returns distance to object.
Definition: CD_PerlinSphereSdf.cpp:45
virtual BaseIF * newImplicitFunction() const
Factory function.
Definition: CD_PerlinSphereSdf.cpp:92
PerlinSphereSdf()
No weak construction.
Definition: CD_PerlinSphereSdf.H:32
RealVect m_center
Center.
Definition: CD_PerlinSphereSdf.H:89
virtual ~PerlinSphereSdf()
Destructor (does nothing)
Definition: CD_PerlinSphereSdf.cpp:41
bool m_inside
Inside/outside.
Definition: CD_PerlinSphereSdf.H:94