Marine systems simulation
Loading...
Searching...
No Matches
marenv::wave::LinearWaveTheory Class Reference

Parent class for linear wave theories used to simulate gravity waves.

#include <LinearWaveTheory.h>

+ Inheritance diagram for marenv::wave::LinearWaveTheory:
+ Collaboration diagram for marenv::wave::LinearWaveTheory:

Public Member Functions

 LinearWaveTheory (std::shared_ptr< WaveComponents > waveComponents, std::string waveTheoryName)
 
WaveField::InsecureDatapointers GetWaveComponents () const override
 
std::string SpectrumName () const override
 
std::string WaveTheoryName () const override
 
WaveComponentData GetWaveComponentsCopy () const override
 
void BlendInPlace (WaveComponentData &other, double alpha) override
 
- Public Member Functions inherited from marenv::wave::WaveField
virtual ~WaveField ()=default
 Virtual destructor.
 
virtual marenv::Status ComputeSurfaceElevation (double time, const double pos[2], double &elevationOut)=0
 
virtual marenv::Status ComputeDynamicPressure (double time, const double pos[3], double &pressureOut)=0
 
virtual marenv::Status ComputeTotalPressure (double time, const double pos[3], double &pressureOut)=0
 
virtual marenv::Status ComputeSurfaceUnitNormal (double time, const double pos[2], double unitNormalOut[3])=0
 
virtual marenv::Status ComputeParticleVelocity (double time, const double pos[3], double velOut[3])=0
 
virtual marenv::Status ComputeParticleAcceleration (double time, const double pos[3], double accOut[3])=0
 
virtual marenv::Status ComputePointQuery (double time, const double pos[3], double &surface_elevation, double surface_unit_normal[3], double particle_velocity[3], double particle_acceleration[3], double &pressure)=0
 
virtual marenv::wave::WaveComponentData GetWaveComponentsCopy (double time, size_t maxComponents=0) const
 

Protected Member Functions

std::shared_ptr< WaveSnapshotLoadSnapshot () const
 
void StoreSnapshot (std::shared_ptr< WaveSnapshot > snap)
 
- Protected Member Functions inherited from marenv::wave::WaveField
 WaveField ()=default
 Constructor.
 

Protected Attributes

std::string m_spectrumName
 The name of the wave spectrum.
 
std::string m_waveTheoryName
 The name of the wave theory.
 

Constructor & Destructor Documentation

◆ LinearWaveTheory()

marenv::wave::LinearWaveTheory::LinearWaveTheory ( std::shared_ptr< WaveComponents waveComponents,
std::string  waveTheoryName 
)

Constructor

Parameters
waveComponentsThe wave components in terms of amplitudes etc.
waveTheoryNameThe wavetheory used. Gerstner or Airy.

Member Function Documentation

◆ BlendInPlace()

void marenv::wave::LinearWaveTheory::BlendInPlace ( WaveComponentData other,
double  alpha 
)
overridevirtual

Interpolates the wave components towards another set of wave components

Parameters
[in]otherThe other set of wave components
[in]alphaThe blend factor, the relative weight of the other wave components

Implements marenv::wave::WaveField.

◆ GetWaveComponents()

WaveField::InsecureDatapointers marenv::wave::LinearWaveTheory::GetWaveComponents ( ) const
overridevirtual

Getter for wave component pointers.

Returns
A structure with pointers to wave component data.

Their use focus on efficiency. Care should be taken to only use these pointers while they are valid.

Implements marenv::wave::WaveField.

◆ GetWaveComponentsCopy()

WaveComponentData marenv::wave::LinearWaveTheory::GetWaveComponentsCopy ( ) const
overridevirtual

Getter for a copy of wave component specifications.

Returns
A structure with wave component data.

Implements marenv::wave::WaveField.

◆ LoadSnapshot()

std::shared_ptr< WaveSnapshot > marenv::wave::LinearWaveTheory::LoadSnapshot ( ) const
inlineprotected

Atomically loads and returns the current snapshot.

All Compute* methods must call this once at entry and use the returned shared_ptr for their entire duration — never access m_snapshot twice.

◆ SpectrumName()

std::string marenv::wave::LinearWaveTheory::SpectrumName ( ) const
overridevirtual

Getter for the name of the wave spectrum used for the realisation of the waves.

Returns
Ittc or Jonswap.

Implements marenv::wave::WaveField.

◆ StoreSnapshot()

void marenv::wave::LinearWaveTheory::StoreSnapshot ( std::shared_ptr< WaveSnapshot snap)
inlineprotected

Atomically publishes a new snapshot. Old snapshot is kept alive until

all in-flight Compute* calls that hold a local copy of it finish.

◆ WaveTheoryName()

std::string marenv::wave::LinearWaveTheory::WaveTheoryName ( ) const
overridevirtual

Getter for the name of the wave theory used for the realisation of the waves.

Returns
Airy or Gerstner.

Implements marenv::wave::WaveField.


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