chombo-discharge
Public Member Functions | Protected Attributes | List of all members
BoundedNoisePlane Class Reference

Infinite plane with spatially bounded surface noise (Perlin noise). More...

#include <CD_BoundedNoisePlane.H>

Inheritance diagram for BoundedNoisePlane:
Inheritance graph
[legend]
Collaboration diagram for BoundedNoisePlane:
Collaboration graph
[legend]

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. More...
 
 BoundedNoisePlane (const BoundedNoisePlane &a_inputIF)
 Copy constructor. More...
 
virtual ~BoundedNoisePlane ()
 Destructor (does nothing)
 
virtual Real value (const RealVect &a_pos) const
 Value function. More...
 
virtual BaseIF * newImplicitFunction () const
 Factory method. More...
 

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ BoundedNoisePlane() [1/2]

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.

Parameters
[in]a_orientationPlane orientation. Must be x+, x-, y+, y-, etc
[in]a_pointPoint on the plane
[in]a_clampLoLow clamped corner.
[in]a_clampHiHigh clamped corner.
[in]a_clampKK-value for clamping.
[in]a_noiseAmpNoise amplitude
[in]a_noiseFreqNoise frequency
[in]a_persistenceFactor for noise octaves.
[in]a_octavesNumber of octaves
[in]a_reseedIf true, reseed the RNG. Otherwise, the the original Perlin hash table.
Note
The persistence argument indicates how we add octaves. With 0.5 we use half the amplitude and twice the frequency for the next octave.

◆ BoundedNoisePlane() [2/2]

BoundedNoisePlane::BoundedNoisePlane ( const BoundedNoisePlane a_inputIF)

Copy constructor.

Parameters
[in]a_inputIFOther plane

Member Function Documentation

◆ newImplicitFunction()

BaseIF * BoundedNoisePlane::newImplicitFunction ( ) const
virtual

Factory method.

Returns
Returns new plane with same parameters.

◆ value()

Real BoundedNoisePlane::value ( const RealVect &  a_pos) const
virtual

Value function.

Parameters
[in]a_posPosition

The documentation for this class was generated from the following files: