chombo-discharge
|
Infinite plane with spatially bounded surface noise (Perlin noise). More...
#include <CD_BoundedNoisePlane.H>
Public Member Functions | |
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. | |
BoundedNoisePlane (const BoundedNoisePlane &a_inputIF) | |
Copy constructor. | |
virtual | ~BoundedNoisePlane () |
Destructor (does nothing) | |
virtual Real | value (const RealVect &a_pos) const |
Value function. | |
virtual BaseIF * | newImplicitFunction () const |
Factory method. | |
Protected Attributes | |
std::pair< int, int > | m_normal |
Plane normal. This is in the form of a coordinate direction and a sign. | |
RealVect | m_point |
Plane point. | |
RealVect | m_clampLo |
Low clamped value. | |
RealVect | m_clampHi |
Low clamped value. | |
Real | m_clampK |
Transition length. | |
Real | m_maxAmp |
Maximum noise amplitude. | |
RefCountedPtr< BaseIF > | m_plane |
BaseIF function for a plane without noise. | |
RefCountedPtr< BaseIF > | m_perlin |
Noise function. | |
Infinite plane with spatially bounded surface noise (Perlin noise).
The surface noise is bounded by a smoothed boxcar function between the input arguments. The boxcar function is given by b(x) = h(x-a) - h(x-b) where h(x) = 1/(1 + exp(-2*k*x)) where k determines the falloff.
BoundedNoisePlane::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.
[in] | a_orientation | Plane orientation. Must be x+, x-, y+, y-, etc |
[in] | a_point | Point on the plane |
[in] | a_clampLo | Low clamped corner. |
[in] | a_clampHi | High clamped corner. |
[in] | a_clampK | K-value for clamping. |
[in] | a_noiseAmp | Noise amplitude |
[in] | a_noiseFreq | Noise frequency |
[in] | a_persistence | Factor for noise octaves. |
[in] | a_octaves | Number of octaves |
[in] | a_reseed | If true, reseed the RNG. Otherwise, the the original Perlin hash table. |
BoundedNoisePlane::BoundedNoisePlane | ( | const BoundedNoisePlane & | a_inputIF | ) |
Copy constructor.
[in] | a_inputIF | Other plane |
|
virtual |
Factory method.
Value function.
[in] | a_pos | Position |