chombo-discharge
CD_BoundedNoisePlane.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_BoundedNoisePlane_H
13 #define CD_BoundedNoisePlane_H
14 
15 // Chombo includes
16 #include <PlaneIF.H>
17 #include <BaseIF.H>
18 
19 // Our includes
20 #include <CD_PerlinSdf.H>
21 #include <CD_NamespaceHeader.H>
22 
28 class BoundedNoisePlane : public BaseIF
29 {
30 public:
45  BoundedNoisePlane(const std::string a_orientation,
46  const RealVect a_point,
47  const RealVect a_clampLo,
48  const RealVect a_clampHi,
49  const Real a_clampK,
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);
59  BoundedNoisePlane(const BoundedNoisePlane& a_inputIF);
60 
64  virtual ~BoundedNoisePlane();
65 
70  virtual Real
71  value(const RealVect& a_pos) const;
72 
77  virtual BaseIF*
78  newImplicitFunction() const;
79 
80 protected:
84  std::pair<int, int> m_normal;
85 
89  RealVect m_point;
90 
94  RealVect m_clampLo;
95 
99  RealVect m_clampHi;
100 
104  Real m_clampK;
105 
109  Real m_maxAmp;
110 
114  RefCountedPtr<BaseIF> m_plane;
115 
119  RefCountedPtr<BaseIF> m_perlin;
120 };
121 
122 #include <CD_NamespaceFooter.H>
123 
124 #endif
Declaration of signed distance Perlin noise.
Infinite plane with spatially bounded surface noise (Perlin noise).
Definition: CD_BoundedNoisePlane.H:29
RealVect m_clampHi
Low clamped value.
Definition: CD_BoundedNoisePlane.H:99
RefCountedPtr< BaseIF > m_plane
BaseIF function for a plane without noise.
Definition: CD_BoundedNoisePlane.H:114
BoundedNoisePlane(const std::string a_orientation, const RealVect a_point, const RealVect a_clampLo, const RealVect a_clampHi, const Real a_clampK, const Real a_noiseAmp, const RealVect a_noiseFreq, const Real a_persistence, const int a_octaves, const bool a_reseed=false)
Full constructor.
Definition: CD_BoundedNoisePlane.cpp:19
RefCountedPtr< BaseIF > m_perlin
Noise function.
Definition: CD_BoundedNoisePlane.H:119
RealVect m_point
Plane point.
Definition: CD_BoundedNoisePlane.H:89
virtual BaseIF * newImplicitFunction() const
Factory method.
Definition: CD_BoundedNoisePlane.cpp:119
Real m_maxAmp
Maximum noise amplitude.
Definition: CD_BoundedNoisePlane.H:109
std::pair< int, int > m_normal
Plane normal. This is in the form of a coordinate direction and a sign.
Definition: CD_BoundedNoisePlane.H:84
virtual Real value(const RealVect &a_pos) const
Value function.
Definition: CD_BoundedNoisePlane.cpp:92
virtual ~BoundedNoisePlane()
Destructor (does nothing)
Definition: CD_BoundedNoisePlane.cpp:88
Real m_clampK
Transition length.
Definition: CD_BoundedNoisePlane.H:104
RealVect m_clampLo
Low clamped value.
Definition: CD_BoundedNoisePlane.H:94