chombo-discharge
Loading...
Searching...
No Matches
CD_RandomInterface.H
Go to the documentation of this file.
1/* chombo-discharge
2 * Copyright © 2024 SINTEF Energy Research.
3 * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4 */
5
12#ifndef CD_RandomInterface_H
13#define CD_RandomInterface_H
14
15#include <CD_EBGeometryIF.H>
17#include <CD_NamespaceHeader.H>
18
23{
24public:
28 RandomInterface() noexcept;
29
33 virtual ~RandomInterface() noexcept;
34
35protected:
39 using Vec3 = EBGeometry::Vec3T<Real>;
40
44 class ClampedNoisePlane : public EBGeometry::SignedDistanceFunction<Real>
45 {
46 public:
51
64 ClampedNoisePlane(const Vec3 a_point,
65 const Vec3 a_normal,
66 const Vec3 a_clampLo,
67 const Vec3 a_clampHi,
68 const Vec3 a_clampDx,
69 const Vec3 a_noiseFrequency,
70 const Real a_noiseAmplitude,
71 const Real a_noisePersistence,
72 const int a_noiseOctaves) noexcept;
73
77 ~ClampedNoisePlane() = default;
78
82 template <class URNG>
83 void
84 shuffle(URNG& a_rng) noexcept;
85
90 virtual Real
91 signedDistance(const Vec3& a_point) const noexcept override;
92
93 protected:
98
103
108
113
118
122 std::shared_ptr<EBGeometry::PlaneSDF<Real>> m_plane;
123
127 std::shared_ptr<EBGeometry::PerlinSDF<Real>> m_perlin;
128 };
129};
130
131#include <CD_NamespaceFooter.H>
132
133#endif
Declaration of base class for defining geometries.
Binding of EBGeometry signed distance functions to Chombo objcts.
Abstract base class for geometries.
Definition CD_ComputationalGeometry.H:36
Clamped noisy plane signed distance function.
Definition CD_RandomInterface.H:45
ClampedNoisePlane()=delete
Disallowed weak construction.
virtual Real signedDistance(const Vec3 &a_point) const noexcept override
Signed distance function.
Definition CD_RandomInterface.cpp:59
Vec3 m_normal
Plane normal vector.
Definition CD_RandomInterface.H:102
Vec3 m_point
Point on plane.
Definition CD_RandomInterface.H:97
~ClampedNoisePlane()=default
Destructor (does nothing)
void shuffle(URNG &a_rng) noexcept
Shuffle the permutation array.
Definition CD_RandomInterface.cpp:53
Vec3 m_clampLo
Low-end clamping.
Definition CD_RandomInterface.H:107
std::shared_ptr< EBGeometry::PlaneSDF< Real > > m_plane
Base implicit function.
Definition CD_RandomInterface.H:122
std::shared_ptr< EBGeometry::PerlinSDF< Real > > m_perlin
Noise function.
Definition CD_RandomInterface.H:127
Vec3 m_clampHi
High-end clamping.
Definition CD_RandomInterface.H:112
Vec3 m_clampDx
Clamping length.
Definition CD_RandomInterface.H:117
Class that represents two random interface smooshed together.
Definition CD_RandomInterface.H:23
RandomInterface() noexcept
Constructor.
Definition CD_RandomInterface.cpp:79
EBGeometry::Vec3T< Real > Vec3
Alias for 3D vector type.
Definition CD_RandomInterface.H:39
virtual ~RandomInterface() noexcept
Destructor (does nothing)
Definition CD_RandomInterface.cpp:229