6#include <boost/ptr_container/ptr_vector.hpp>
8#include "include/Sfx_PhysicalSystem.h"
9#include "include/Sfx_StateVector.h"
10#include "include/Sfx_Observable.h"
16#include "Sfx/Sfx_NodalValues.h"
30 virtual public Sfx::Observable
37 using vecidx = std::vector<float64>::size_type;
38 using pair_vecarr = std::pair<std::vector<float64>, std::vector<float64>>;
40 using value_type = boost::ptr_vector<Sfx::Nodal_Value>::value_type;
41 using size_type = boost::ptr_vector<Sfx::Nodal_Value>::size_type;
42 using iterator = boost::ptr_vector<Sfx::Nodal_Value>::iterator;
69 void add( Sfx::Object* aNval)
override final;
75 bool contains(
const Sfx::Object* aN2find)
override final;
81 bool remove(
const Sfx::Object* aN2find)
override final;
86 [[nodiscard]]
bool empty() const noexcept override final {
return m_Objs.empty(); }
91 size_t size() const override final {
return m_Objs.size(); }
105 aSectionFlow.setH(std::get<2>(m_Objs[aSectionFlow.getId()].Values()));
142 std::vector<float64>
getH()
const
144 std::vector<float64> w_vecH;
148 w_vecH.push_back(w_sect.H());
173 return Sfx::StateVector{
m_phyState.first[aSectionIdx],
182 std::for_each(
begin(),
end(), [*
this](Sfx::Nodal_Value& aPhyObj)
185 aPhyObj.Values( std::make_tuple(
m_phyState.first[aPhyObj.getIdX().first],
204 void attach(Sfx::Observer* aObs2Attach)
override final;
209 void detach(Sfx::Observer* aObs2Detach)
override final;
213 void notify() override final;
221 boost::ptr_vector<Sfx::Nodal_Value>
m_Objs;
DamBreakSystem(std::string aName="DamBreakSystem")
ctor
Definition Testvs19_DamBreakSystem.cpp:24
iterator begin()
STL-like interface.
Definition Testvs19_DamBreakSystem.h:50
std::list< Sfx::Observer * > m_listObs
Definition Testvs19_DamBreakSystem.h:222
void detach(Sfx::Observer *aObs2Detach) override final
Remove an observer.
Definition Testvs19_DamBreakSystem.cpp:16
iterator end()
Definition Testvs19_DamBreakSystem.h:51
std::shared_ptr< ListSectionsFlow< dbpp::SectionFlow > > ListSectionFlowPtr
Aliases.
Definition Testvs19_DamBreakSystem.h:36
void setPhysicalState(phystate aState)
Setter.
Definition Testvs19_DamBreakSystem.h:161
std::vector< float64 >::size_type vecidx
Definition Testvs19_DamBreakSystem.h:37
void update()
Update Nodal Values (flat bed Z=0, unit width)
Definition Testvs19_DamBreakSystem.h:179
bool remove(const Sfx::Object *aN2find) override final
Remove an object from system.
Definition Testvs19_DamBreakSystem.cpp:95
auto crbegin() const
Definition Testvs19_DamBreakSystem.h:56
void setH()
Definition Testvs19_DamBreakSystem.h:99
bool empty() const noexcept override final
check if system contains any object
Definition Testvs19_DamBreakSystem.h:86
void notify() override final
Notify all observers.
Definition Testvs19_DamBreakSystem.cpp:107
Sfx::StateVector getSectionStateVector(vecidx aSectionIdx) const
Retrieve state variables of a section flow.
Definition Testvs19_DamBreakSystem.h:171
ListSectionFlowPtr getListSectionFlow() const
Getter.
Definition Testvs19_DamBreakSystem.h:194
size_t size() const override final
Number of elements.
Definition Testvs19_DamBreakSystem.h:91
boost::ptr_vector< Sfx::Nodal_Value >::value_type value_type
Definition Testvs19_DamBreakSystem.h:40
std::string m_name
Definition Testvs19_DamBreakSystem.h:216
boost::ptr_vector< Sfx::Nodal_Value >::size_type size_type
Definition Testvs19_DamBreakSystem.h:41
boost::ptr_vector< Sfx::Nodal_Value > m_Objs
Definition Testvs19_DamBreakSystem.h:221
bool contains(const Sfx::Object *aN2find) override final
Check if object already added.
Definition Testvs19_DamBreakSystem.cpp:65
ListSectionFlowPtr m_listOfSections
Definition Testvs19_DamBreakSystem.h:218
const_iterator cend() const
Definition Testvs19_DamBreakSystem.h:53
const_iterator cbegin() const
Definition Testvs19_DamBreakSystem.h:52
void attach(Sfx::Observer *aObs2Attach) override final
Add an observer.
Definition Testvs19_DamBreakSystem.cpp:12
std::vector< float64 > getH() const
Water depth.
Definition Testvs19_DamBreakSystem.h:142
phystate m_phyState
Definition Testvs19_DamBreakSystem.h:217
boost::ptr_vector< Sfx::Nodal_Value >::const_iterator const_iterator
Definition Testvs19_DamBreakSystem.h:43
auto rend()
Definition Testvs19_DamBreakSystem.h:55
boost::ptr_vector< Sfx::Nodal_Value >::iterator iterator
Definition Testvs19_DamBreakSystem.h:42
pair_vecarr phystate
Definition Testvs19_DamBreakSystem.h:39
std::pair< std::vector< float64 >, std::vector< float64 > > pair_vecarr
Definition Testvs19_DamBreakSystem.h:38
phystate getPhysicalState() const
Getter.
Definition Testvs19_DamBreakSystem.h:156
auto rbegin()
Definition Testvs19_DamBreakSystem.h:54
void add(Sfx::Object *aNval) override final
Add object to the system.
Definition Testvs19_DamBreakSystem.cpp:47
auto crend() const
Definition Testvs19_DamBreakSystem.h:57
Cross-sectional flow (2-dimensional).
Definition dbpp_SectionFlow.h:16
Definition Testvs19_BaseRhsPhysicsAlgorithm.cpp:19
constexpr float64 Evaluation_H_fonction_A(float64 A, float64 Z, float64 B=1.)
Function that evaluate water level in terms section width and bathymetry.
Definition dbpp_SimulationUtilities.hpp:164