chombo-discharge
Loading...
Searching...
No Matches
CD_RandomInterface.H
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021-2026 SINTEF Energy Research
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
13#ifndef CD_RANDOMINTERFACE_H
14#define CD_RANDOMINTERFACE_H
15
16#include <CD_EBGeometryIF.H>
18#include <CD_NamespaceHeader.H>
19
24{
25public:
29 RandomInterface() noexcept;
30
34 virtual ~RandomInterface() noexcept;
35
36protected:
40 using Vec3 = EBGeometry::Vec3T<Real>;
41
45 class ClampedNoisePlane : public EBGeometry::SignedDistanceFunction<Real>
46 {
47 public:
52
65 ClampedNoisePlane(const Vec3& a_point,
66 const Vec3& a_normal,
67 const Vec3& a_clampLo,
68 const Vec3& a_clampHi,
69 const Vec3& a_clampDx,
70 const Vec3& a_noiseFrequency,
71 const Real a_noiseAmplitude,
72 const Real a_noisePersistence,
73 const int a_noiseOctaves) noexcept;
74
78 ~ClampedNoisePlane() = default;
79
84 template <class URNG>
85 void
86 shuffle(URNG& a_rng) noexcept;
87
93 virtual Real
94 signedDistance(const Vec3& a_point) const noexcept override;
95
96 protected:
101
106
111
116
121
125 std::shared_ptr<EBGeometry::PlaneSDF<Real>> m_plane;
126
130 std::shared_ptr<EBGeometry::PerlinSDF<Real>> m_perlin;
131 };
132};
133
134#include <CD_NamespaceFooter.H>
135
136#endif
Declaration of base class for defining geometries.
Binding of EBGeometry signed distance functions to Chombo objects.
Abstract base class for geometries.
Definition CD_ComputationalGeometry.H:37
Clamped noisy plane signed distance function.
Definition CD_RandomInterface.H:46
ClampedNoisePlane()=delete
Disallowed weak construction.
virtual Real signedDistance(const Vec3 &a_point) const noexcept override
Signed distance function.
Definition CD_RandomInterface.cpp:58
Vec3 m_normal
Plane normal vector.
Definition CD_RandomInterface.H:105
Vec3 m_point
Point on plane.
Definition CD_RandomInterface.H:100
~ClampedNoisePlane()=default
Destructor (does nothing)
void shuffle(URNG &a_rng) noexcept
Shuffle the permutation array.
Definition CD_RandomInterface.cpp:52
Vec3 m_clampLo
Low-end clamping.
Definition CD_RandomInterface.H:110
std::shared_ptr< EBGeometry::PlaneSDF< Real > > m_plane
Base implicit function.
Definition CD_RandomInterface.H:125
std::shared_ptr< EBGeometry::PerlinSDF< Real > > m_perlin
Noise function.
Definition CD_RandomInterface.H:130
Vec3 m_clampHi
High-end clamping.
Definition CD_RandomInterface.H:115
Vec3 m_clampDx
Clamping length.
Definition CD_RandomInterface.H:120
Class that represents two random interface smooshed together.
Definition CD_RandomInterface.H:24
RandomInterface() noexcept
Constructor.
Definition CD_RandomInterface.cpp:78
EBGeometry::Vec3T< Real > Vec3
Alias for 3D vector type.
Definition CD_RandomInterface.H:40
virtual ~RandomInterface() noexcept
Destructor (does nothing)
Definition CD_RandomInterface.cpp:228