DamBreak++ Wave Simulator 0.3
DamBreak++ Simulation Framework
Loading...
Searching...
No Matches
dbpp::PhysicalSystem Class Reference

Physical system made of physical objects under study and described by the state variables. DamBreak physical system, physical objects are cross-sectional flow. Dynamic equations that describe the movement of the flow of water under gravity law, pressure and friction are described by the St-Venant set of equations. In conservative form mass and momentum are the quantity conserved across each section (state variables). More...

#include <dbpp_PhysicalSystem.h>

Inheritance diagram for dbpp::PhysicalSystem:

Classes

struct  BCNodeConstraint
 Type to repesent the nodal constraint. More...

Public Types

using pairStateVar = std::pair<Sfx::StateVariables, Sfx::StateVariables>
 alias template state variables
using SectionStateVar = std::map<unsigned int, pairStateVar >
 alias template map state variables
using StateVectorPair = Sfx::StateVectorField::StateVector
 alias template state variables vector

Public Member Functions

 PhysicalSystem ()
 Default ctor.
virtual void add (const SectionFlow &aSectFlow2Add)
 adding a section
virtual void add (SectionFlow &&aSectFlow2Add)
 rvalue reference version (add a physical object)
SectionStateVar getStateVariables () const noexcept
SectionStateVargetStateVariables () noexcept
 System state variables.
Sfx::StateVectorField getStateVector () const
 physical system state vector (scalar field)
const ListSectionsFlowgetSectionList () const noexcept
ListSectionsFlowgetSectionList () noexcept
std::shared_ptr< ListSectionsFlow > & getListSectionsPtr ()
 list of sections
std::shared_ptr< ListSectionsFlowgetListSectionsPtr () const
 list of sections
bool empty () const noexcept
 check emptyness
ListSectionsFlow::vec_sizetype size () const noexcept
 number of physical objects
void update (const Sfx::StateVectorField &aStateVector)
 update all sections flow and state variables
void update (const std::valarray< float64 > &aVarr1, const std::valarray< float64 > &aVarr2)
 Update state variables.
void update (std::valarray< float64 > &&aVarr1, std::valarray< float64 > &&aVarr2)
 Update state variables.
void setRightPhysicalBnd (std::tuple< uint32, float64, float64, float64 > aRightPhyBnd)
 physical boundary at far end global domain
PhyBCNdlConstraint getRightPhysicalBnd () const noexcept
 Physical boundary.
void setLeftPhysicalBnd (std::tuple< uint32, float64, float64, float64 > aLeftPhyBnd)
 physical boundry left far end of global domain
PhyBCNdlConstraint getLeftPhysicalBnd () const noexcept
 physical boundry left far end of global domain
bool isSystemFictionLess () const noexcept
 friction is used
bool useUnitWidthGeom () const noexcept
 section geometry type
bool useFlatEarth () const noexcept
 falt bed bathymetry
void PhysicalSystemBndType () const noexcept
 type of physical boundary
void attach (Sfx::Observer *aObserver) override final
 attach the observer
void detach (Sfx::Observer *aObserver) override final
 Remove observer from the ist.
void notify () override final
 notify all observers (call update())

Static Public Member Functions

static ListSectionsFlow createSectionFlow (const Sfx::DamBreakData &aDbdata)
 Create list of section flow.

Private Types

enum class  ePhysicalSystemType { halfOpen =0 , close =1 }

Private Attributes

int32 m_nbSectionsFlow = Sfx::DIM::value
std::shared_ptr< ListSectionsFlowm_listSections
SectionStateVar m_stateVarMap
PhyBCNdlConstraint m_bcNodeUpstream
PhyBCNdlConstraint m_bcNodeDownstream
std::list< Sfx::Observer * > m_listOfObserver

Detailed Description

Physical system made of physical objects under study and described by the state variables. DamBreak physical system, physical objects are cross-sectional flow. Dynamic equations that describe the movement of the flow of water under gravity law, pressure and friction are described by the St-Venant set of equations. In conservative form mass and momentum are the quantity conserved across each section (state variables).

To be more specific, it's an observable (physicist language). It contains Observers, variable that w are interested to.

Abstract class, user will derive from this class to define it's own physical system.

Member Typedef Documentation

◆ pairStateVar

using dbpp::PhysicalSystem::pairStateVar = std::pair<Sfx::StateVariables, Sfx::StateVariables>

alias template state variables

◆ SectionStateVar

using dbpp::PhysicalSystem::SectionStateVar = std::map<unsigned int, pairStateVar >

alias template map state variables

◆ StateVectorPair

using dbpp::PhysicalSystem::StateVectorPair = Sfx::StateVectorField::StateVector

alias template state variables vector

Member Enumeration Documentation

◆ ePhysicalSystemType

An enum type Physical domain type

Enumerator
halfOpen 

half-open domain

close 

closed domain

Constructor & Destructor Documentation

◆ PhysicalSystem()

dbpp::PhysicalSystem::PhysicalSystem ( )

Default ctor.

Member Function Documentation

◆ add() [1/2]

void dbpp::PhysicalSystem::add ( const SectionFlow & aSectFlow2Add)
virtual

adding a section

Parameters
aSectFlow2Addphysical object added

◆ add() [2/2]

void dbpp::PhysicalSystem::add ( SectionFlow && aSectFlow2Add)
virtual

rvalue reference version (add a physical object)

Parameters
aSectFlow2Addphysical object added

◆ attach()

void dbpp::PhysicalSystem::attach ( Sfx::Observer * aObserver)
finaloverride

attach the observer

Parameters
aObserveran observer to add

◆ createSectionFlow()

ListSectionsFlow dbpp::PhysicalSystem::createSectionFlow ( const Sfx::DamBreakData & aDbdata)
inlinestatic

Create list of section flow.

Parameters
aDbdatadata
Returns
List of section flow

◆ detach()

void dbpp::PhysicalSystem::detach ( Sfx::Observer * aObserver)
finaloverride

Remove observer from the ist.

Parameters
aObserverobserver to remove

◆ empty()

bool dbpp::PhysicalSystem::empty ( ) const
inlinenodiscardnoexcept

check emptyness

Returns
true/false

◆ getLeftPhysicalBnd()

PhyBCNdlConstraint dbpp::PhysicalSystem::getLeftPhysicalBnd ( ) const
inlinenoexcept

physical boundry left far end of global domain

Returns
physical boundry value

◆ getListSectionsPtr() [1/2]

std::shared_ptr< ListSectionsFlow > & dbpp::PhysicalSystem::getListSectionsPtr ( )
inline

list of sections

Returns
shared pointer of list of sections

◆ getListSectionsPtr() [2/2]

std::shared_ptr< ListSectionsFlow > dbpp::PhysicalSystem::getListSectionsPtr ( ) const
inline

list of sections

Returns
shared pointer of list of sections

◆ getRightPhysicalBnd()

PhyBCNdlConstraint dbpp::PhysicalSystem::getRightPhysicalBnd ( ) const
inlinenoexcept

Physical boundary.

Returns
Nodal contraint right far end of global domain

◆ getSectionList() [1/2]

const ListSectionsFlow & dbpp::PhysicalSystem::getSectionList ( ) const
inlinenoexcept

◆ getSectionList() [2/2]

ListSectionsFlow & dbpp::PhysicalSystem::getSectionList ( )
inlinenoexcept

◆ getStateVariables() [1/2]

SectionStateVar dbpp::PhysicalSystem::getStateVariables ( ) const
inlinenoexcept

◆ getStateVariables() [2/2]

SectionStateVar & dbpp::PhysicalSystem::getStateVariables ( )
inlinenoexcept

System state variables.

Returns
map

◆ getStateVector()

Sfx::StateVectorField dbpp::PhysicalSystem::getStateVector ( ) const

physical system state vector (scalar field)

Returns
state vector field

◆ isSystemFictionLess()

bool dbpp::PhysicalSystem::isSystemFictionLess ( ) const
inlinenoexcept

friction is used

Returns
true/false

◆ notify()

void dbpp::PhysicalSystem::notify ( )
finaloverride

notify all observers (call update())

◆ PhysicalSystemBndType()

void dbpp::PhysicalSystem::PhysicalSystemBndType ( ) const
inlinenoexcept

type of physical boundary

◆ setLeftPhysicalBnd()

void dbpp::PhysicalSystem::setLeftPhysicalBnd ( std::tuple< uint32, float64, float64, float64 > aLeftPhyBnd)
inline

physical boundry left far end of global domain

Parameters
aLeftPhyBndphysical boundry value

◆ setRightPhysicalBnd()

void dbpp::PhysicalSystem::setRightPhysicalBnd ( std::tuple< uint32, float64, float64, float64 > aRightPhyBnd)
inline

physical boundary at far end global domain

Parameters
aRightPhyBndbpoundary value

◆ size()

ListSectionsFlow::vec_sizetype dbpp::PhysicalSystem::size ( ) const
inlinenoexcept

number of physical objects

Returns
number of sections

◆ update() [1/3]

void dbpp::PhysicalSystem::update ( const Sfx::StateVectorField & aStateVector)

update all sections flow and state variables

Parameters
aStateVector

◆ update() [2/3]

void dbpp::PhysicalSystem::update ( const std::valarray< float64 > & aVarr1,
const std::valarray< float64 > & aVarr2 )

Update state variables.

Parameters
aVarr1first state variable
aVarr2second state variable

◆ update() [3/3]

void dbpp::PhysicalSystem::update ( std::valarray< float64 > && aVarr1,
std::valarray< float64 > && aVarr2 )

Update state variables.

Parameters
aVarr1first state variable
aVarr2second state variable

◆ useFlatEarth()

bool dbpp::PhysicalSystem::useFlatEarth ( ) const
inlinenoexcept

falt bed bathymetry

Returns
true/false

◆ useUnitWidthGeom()

bool dbpp::PhysicalSystem::useUnitWidthGeom ( ) const
inlinenoexcept

section geometry type

Returns
true/false

Member Data Documentation

◆ m_bcNodeDownstream

PhyBCNdlConstraint dbpp::PhysicalSystem::m_bcNodeDownstream
private

Far end right boundary

◆ m_bcNodeUpstream

PhyBCNdlConstraint dbpp::PhysicalSystem::m_bcNodeUpstream
private

Far end left boundary

◆ m_listOfObserver

std::list<Sfx::Observer*> dbpp::PhysicalSystem::m_listOfObserver
private

list of observer

◆ m_listSections

std::shared_ptr<ListSectionsFlow> dbpp::PhysicalSystem::m_listSections
private

List of cross-section (physics object)

◆ m_nbSectionsFlow

int32 dbpp::PhysicalSystem::m_nbSectionsFlow = Sfx::DIM::value
private

default number of sections

◆ m_stateVarMap

SectionStateVar dbpp::PhysicalSystem::m_stateVarMap
private

represent state variable for now


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