DamBreak++ Wave Simulator 0.3
DamBreak++ Simulation Framework
Loading...
Searching...
No Matches
Testvs19::Wave1DSimulator Class Reference

Wave simulator (simulate dam-break wave propagation) implementation. More...

#include <Testvs19_Wave1DSimulator.h>

Inheritance diagram for Testvs19::Wave1DSimulator:

Public Types

enum class  eIC { EMcNeil =0 , Hudson = 1 }
enum class  eSimulationState { running =0 , pause =1 , stop =2 }

Public Member Functions

 Wave1DSimulator (int aNbIterationsMax=50, double aCFL=0.6)
 Wave1DSimulator (const Wave1DSimulator &aOther)=delete
 not allowed to copy
Wave1DSimulatoroperator= (const Wave1DSimulator &aOther)=delete
 not allowed to assignment
void run () override final
 Main loop of the simulation.
bool init () override final
 Initialization of the simulator.
void unInitialize () override final
 clean-upof the simulator
virtual void timeLoop ()
 Simulation time loop.
void setActiveAlgortihm (std::string aAlgoName) noexcept
 name of numerical flux algorithm
std::string getactiveAlgorithm () const noexcept
 name of numerical flux algorithm
void setValidationDir (const std::filesystem::path &aValidationDir) noexcept
 directory to store data
std::filesystem::path getValidationDir () const noexcept
 folder to save data
void setSaveResult2File (bool saveResult) noexcept
 flag to set if data is to be saved to file
bool isSaveResult2File () const noexcept
 Save result to file.
void setIterationNumberMax (unsigned aNumMaxIter) noexcept
 number of iterations for this simulation
uint32 getNumberIterationsMax () const noexcept
 number of iterations for this simulation
void setCFL (float64 aCFl) noexcept
 Courant-Friedrich-Levy Number (stability criteria)
float64 getCFL () const noexcept
 Courant-Friedrich-Levy Number (stability criteria)
void setPhi1 (float64 aPhi1) noexcept
 dambreak parameters (wave profile values)
float64 getPhi1 () const noexcept
 dambreak parameters (wave profile values)
void setPhi0 (float64 aPhi0) noexcept
 dambreak parameters (wave profile values)
float64 getPhi0 () const noexcept
 dambreak parameters (wave profile values)
float64 getFinalTime () const
void update () override final
void solveProblem (const dbpp::DamBreakProblem &aDBprob)
 Solve Dam Break problem.
std::valarray< float64 > getH () const noexcept
 water depth at global nodal point
std::shared_ptr< Wave1DSimulatorsharedPtrTo ()
 share the ownership of 'this' with all existing std::shared_ptr that refer to *this.

Private Types

using WaveFuncPtr = std::shared_ptr<Sfx::WaveFunc>
using ListSectPtr = std::shared_ptr<dbpp::ListSectionsFlow>

Private Attributes

WaveFuncPtr m_H {nullptr}
WaveFuncPtr m_I { nullptr }
ListSectPtr m_ListSectFlow {nullptr}
std::vector< float64 > m_waveDepthProfile
float64 m_CFL
std::string m_activeAlgo
std::filesystem::path m_validationDir
bool m_saveResult2File
unsigned int m_NumberIterationsMax
float64 m_Phi1
float64 m_Phi0
float64 m_finalTime
eIC m_IC

Detailed Description

Wave simulator (simulate dam-break wave propagation) implementation.

Member Typedef Documentation

◆ ListSectPtr

aliases

◆ WaveFuncPtr

using Testvs19::Wave1DSimulator::WaveFuncPtr = std::shared_ptr<Sfx::WaveFunc>
private

aliases

Member Enumeration Documentation

◆ eIC

enum class Testvs19::Wave1DSimulator::eIC
strong

An enum type Initial condition

Enumerator
EMcNeil 

Data E. McNeil

Hudson 

Data Hudson

◆ eSimulationState

An enum type Simulator status property

Enumerator
running 

Simulator status (run)

pause 

Simulator status (paused)

stop 

Simulator status (stopped)

Constructor & Destructor Documentation

◆ Wave1DSimulator() [1/2]

Testvs19::Wave1DSimulator::Wave1DSimulator ( int aNbIterationsMax = 50,
double aCFL = 0.6 )
Parameters
aNbIterationsMax
aCFL

◆ Wave1DSimulator() [2/2]

Testvs19::Wave1DSimulator::Wave1DSimulator ( const Wave1DSimulator & aOther)
delete

not allowed to copy

Parameters
aOtheranother simulator to copy from

Member Function Documentation

◆ getactiveAlgorithm()

std::string Testvs19::Wave1DSimulator::getactiveAlgorithm ( ) const
inlinenoexcept

name of numerical flux algorithm

Returns
string name

◆ getCFL()

float64 Testvs19::Wave1DSimulator::getCFL ( ) const
inlinenoexcept

Courant-Friedrich-Levy Number (stability criteria)

Returns
CFL value

◆ getFinalTime()

float64 Testvs19::Wave1DSimulator::getFinalTime ( ) const
inline

◆ getH()

std::valarray< float64 > Testvs19::Wave1DSimulator::getH ( ) const
inlinenoexcept

water depth at global nodal point

Returns
water depth valarray

◆ getNumberIterationsMax()

uint32 Testvs19::Wave1DSimulator::getNumberIterationsMax ( ) const
inlinenoexcept

number of iterations for this simulation

Returns
max number

◆ getPhi0()

float64 Testvs19::Wave1DSimulator::getPhi0 ( ) const
inlinenoexcept

dambreak parameters (wave profile values)

Returns
downstream value

◆ getPhi1()

float64 Testvs19::Wave1DSimulator::getPhi1 ( ) const
inlinenoexcept

dambreak parameters (wave profile values)

Returns
upstream value

◆ getValidationDir()

std::filesystem::path Testvs19::Wave1DSimulator::getValidationDir ( ) const
inlinenoexcept

folder to save data

Returns
folder path

◆ init()

bool Testvs19::Wave1DSimulator::init ( )
finaloverride

Initialization of the simulator.

Returns
true/false on success

◆ isSaveResult2File()

bool Testvs19::Wave1DSimulator::isSaveResult2File ( ) const
inlinenoexcept

Save result to file.

Returns
true/false

◆ operator=()

Wave1DSimulator & Testvs19::Wave1DSimulator::operator= ( const Wave1DSimulator & aOther)
delete

not allowed to assignment

Parameters
aOtheranother simulator to assign from
Returns
this

◆ run()

void Testvs19::Wave1DSimulator::run ( )
finaloverride

Main loop of the simulation.

◆ setActiveAlgortihm()

void Testvs19::Wave1DSimulator::setActiveAlgortihm ( std::string aAlgoName)
inlinenoexcept

name of numerical flux algorithm

Parameters
aAlgoNamename of pointer-to-function

◆ setCFL()

void Testvs19::Wave1DSimulator::setCFL ( float64 aCFl)
inlinenoexcept

Courant-Friedrich-Levy Number (stability criteria)

Parameters
aCFlCFL number

◆ setIterationNumberMax()

void Testvs19::Wave1DSimulator::setIterationNumberMax ( unsigned aNumMaxIter)
inlinenoexcept

number of iterations for this simulation

Parameters
aNumMaxIternumber iterations max

◆ setPhi0()

void Testvs19::Wave1DSimulator::setPhi0 ( float64 aPhi0)
inlinenoexcept

dambreak parameters (wave profile values)

Parameters
aPhi0downstream value

◆ setPhi1()

void Testvs19::Wave1DSimulator::setPhi1 ( float64 aPhi1)
inlinenoexcept

dambreak parameters (wave profile values)

Parameters
aPhi1upstream value

◆ setSaveResult2File()

void Testvs19::Wave1DSimulator::setSaveResult2File ( bool saveResult)
inlinenoexcept

flag to set if data is to be saved to file

Parameters
saveResultboolean

◆ setValidationDir()

void Testvs19::Wave1DSimulator::setValidationDir ( const std::filesystem::path & aValidationDir)
inlinenoexcept

directory to store data

Parameters
aValidationDir

◆ sharedPtrTo()

std::shared_ptr< Wave1DSimulator > Testvs19::Wave1DSimulator::sharedPtrTo ( )
inline

share the ownership of 'this' with all existing std::shared_ptr that refer to *this.

Returns
shared pointer

◆ solveProblem()

void Testvs19::Wave1DSimulator::solveProblem ( const dbpp::DamBreakProblem & aDBprob)

Solve Dam Break problem.

Parameters
aDBprobDamBreak Problem

◆ timeLoop()

void Testvs19::Wave1DSimulator::timeLoop ( )
virtual

Simulation time loop.

◆ unInitialize()

void Testvs19::Wave1DSimulator::unInitialize ( )
inlinefinaloverride

clean-upof the simulator

◆ update()

void Testvs19::Wave1DSimulator::update ( )
finaloverride

Member Data Documentation

◆ m_activeAlgo

std::string Testvs19::Wave1DSimulator::m_activeAlgo
private

Current algorithm

◆ m_CFL

float64 Testvs19::Wave1DSimulator::m_CFL
private

CFL number

◆ m_finalTime

float64 Testvs19::Wave1DSimulator::m_finalTime
private

Simulation final time

◆ m_H

WaveFuncPtr Testvs19::Wave1DSimulator::m_H {nullptr}
private

depth function(water height)

◆ m_I

WaveFuncPtr Testvs19::Wave1DSimulator::m_I { nullptr }
private

initial surface function (bottom topography)

◆ m_IC

eIC Testvs19::Wave1DSimulator::m_IC
private

Initial condition

◆ m_ListSectFlow

ListSectPtr Testvs19::Wave1DSimulator::m_ListSectFlow {nullptr}
private

list of section flow (why a pointer?)

◆ m_NumberIterationsMax

unsigned int Testvs19::Wave1DSimulator::m_NumberIterationsMax
private

Number max iterations

◆ m_Phi0

float64 Testvs19::Wave1DSimulator::m_Phi0
private

Water Height value downstream

◆ m_Phi1

float64 Testvs19::Wave1DSimulator::m_Phi1
private

Water Height value upstream

◆ m_saveResult2File

bool Testvs19::Wave1DSimulator::m_saveResult2File
private

boolean to save result

◆ m_validationDir

std::filesystem::path Testvs19::Wave1DSimulator::m_validationDir
private

Algorithm Validation folder

◆ m_waveDepthProfile

std::vector<float64> Testvs19::Wave1DSimulator::m_waveDepthProfile
private

Water depth values


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