DamBreak++ Wave Simulator 0.3
DamBreak++ Simulation Framework
Loading...
Searching...
No Matches
dbpp_RhsPtr2FuncFlux.h
Go to the documentation of this file.
1#pragma once
2
3// C++ includes
4#include <algorithm>
5#include <vector>
6// VS19 includes
12// App include
14
15namespace dbpp
16{
20 class RhsPtr2FuncFlux final : public SweRhsAlgorithm
21 {
22 public:
27 // should pass the physical system, retrieve physical boundary condition
28 // and list of physical objects under study, section flow (next version)
29 RhsPtr2FuncFlux( std::string aFFname, CalculFF aPtr2Func, const ListSectionsFlow& aSectionList, bool aUsePressure=false);
37 RhsPtr2FuncFlux( std::string aFFname, CalculFF aPtr2Func, SrcNumericalTreatment* aSrcTreatment,
38 bool aUsePressure);
43 void setPhysicalBoundaryCnd( const PhysicalBoundaryCnd& aPhyBnd) override
44 {
45 m_leftBcNode = aPhyBnd.getLeftEnd();
46 m_rightBcNode = aPhyBnd.getRightEnd();
47 }
48
56
60 //void setPtr2FuncAlgo(CalculFF aPtr2Func) override final { m_fluxPtr2Func = aPtr2Func; }
61
67 bool useManningFormula = true) override { m_srcDiscr = aSrcDiscr; }
68
72 std::string getPtr2FuncName() const noexcept { return m_ptr2funcName; }
78 SweRhsData<> calculate( const Sfx::StateVectorField& aU) override final;
85 SweRhsData<> calculate( const Sfx::StateVectorField& aU, const ListSectionsFlow& aList);
92 SweRhsData<> calculate(const Sfx::StateVectorField& aU,
93 const std::shared_ptr<FiniteVolumeDiscretization>& aGblDiscr) override final;
98 bool useReconstruction() const noexcept override final { return m_ptr2FuncFF.useReconstr(); }
103 bool isFrictionLess() const noexcept override final
104 {
105 if( m_srcDiscr!=nullptr)
106 {
107 return m_srcDiscr->useFriction();
108 }
109
110 return m_listSections.isFrictionLess(); // depends Manning coeff used in ptr-to-func (need to be adressed)
111 }
112
116 bool usePressureTerm() const noexcept override final { return m_usePressure; }
121 bool useSourceTerms() const noexcept override final { return m_useSourceTerms; }
126 bool useIncompleteFlux() const noexcept override final { return m_ptr2FuncFF.usePhysicalInCompleteFlux(); }
131 bool usePtr2FuncLegacy() const noexcept override final { return true; }
132 bool supportTraitementTermeS2() const { return true; } //???
133
134 // list of section flow (return by-value)
136 private:
137 std::string m_ptr2funcName;
144 // bool m_useFriction; /**< friction use*/
147 // bool m_isFlatEarth; /**< section geometry*/
148 };
149} // End of namespace
dbpp::NodalTpl< unsigned, float64, float64, float64 > PhyBCNdlConstraint
Physics computational domain (phenomena take place: half-open as default)
Definition SimulationConfig.h:39
void(*)(DBSArrayType &aFF1, DBSArrayType &aFF2, const DBSArrayType &aU1, const DBSArrayType &aU2) CalculFF
PointerToFunction(numerical flux computation)
Definition SimulationConfig.h:32
List of cross-section flow (itereable)
Definition dbpp_ListSectionsFlow.h:15
Physical boundary condition (computational domain) based on characteristic equation ....
Definition dbpp_PhysicalBoundaryCnd.h:22
PhyBCNdlConstraint getRightEnd() const
Right boundary.
Definition dbpp_PhysicalBoundaryCnd.h:62
PhyBCNdlConstraint getLeftEnd() const
Left boundary.
Definition dbpp_PhysicalBoundaryCnd.h:52
Numerical Face Flux Algorithm (Legacy code support Pointer-2-Function)
Definition dbpp_HLLegacyFluxAlgorithm.h:27
RhsPtr2FuncFlux(std::string aFFname, CalculFF aPtr2Func, const ListSectionsFlow &aSectionList, bool aUsePressure=false)
Definition dbpp_RhsPtr2FuncFlux.cpp:28
void setPhysicalBoundaryCnd(const PhysicalBoundaryCnd &aPhyBnd) override
physical boundary condition
Definition dbpp_RhsPtr2FuncFlux.h:43
bool m_useSourceTerms
Definition dbpp_RhsPtr2FuncFlux.h:146
bool useSourceTerms() const noexcept override final
compute source terms
Definition dbpp_RhsPtr2FuncFlux.h:121
SweRhsData calculate(const Sfx::StateVectorField &aU) override final
compute RHS terms
Definition dbpp_RhsPtr2FuncFlux.cpp:63
std::string getPtr2FuncName() const noexcept
getter
Definition dbpp_RhsPtr2FuncFlux.h:72
ListSectionsFlow m_listSections
Definition dbpp_RhsPtr2FuncFlux.h:139
bool usePtr2FuncLegacy() const noexcept override final
use legacy code version of flux algorithm
Definition dbpp_RhsPtr2FuncFlux.h:131
PhyBCNdlConstraint m_leftBcNode
Definition dbpp_RhsPtr2FuncFlux.h:140
bool m_usePressure
Definition dbpp_RhsPtr2FuncFlux.h:145
PhysicalBoundaryCnd getPhysicalBoundaryCnd() const override final
physical boundary condition
Definition dbpp_RhsPtr2FuncFlux.h:52
bool usePressureTerm() const noexcept override final
take account of the pressure
Definition dbpp_RhsPtr2FuncFlux.h:116
bool useIncompleteFlux() const noexcept override final
physical flux type
Definition dbpp_RhsPtr2FuncFlux.h:126
void setSourceTermDiscr(SrcNumericalTreatment *aSrcDiscr, bool useManningFormula=true) override
not sure about this one
Definition dbpp_RhsPtr2FuncFlux.h:66
PhyBCNdlConstraint m_rightBcNode
Definition dbpp_RhsPtr2FuncFlux.h:141
CalculFF m_calculFF
Definition dbpp_RhsPtr2FuncFlux.h:138
~RhsPtr2FuncFlux()
dtor from pointer-to-function and source treatment
Definition dbpp_RhsPtr2FuncFlux.cpp:20
SrcNumericalTreatment * m_srcDiscr
Definition dbpp_RhsPtr2FuncFlux.h:143
bool supportTraitementTermeS2() const
Definition dbpp_RhsPtr2FuncFlux.h:132
std::string m_ptr2funcName
Definition dbpp_RhsPtr2FuncFlux.h:137
ListSectionsFlow getListSections() const
Definition dbpp_RhsPtr2FuncFlux.h:135
Ptr2FLegacyFluxAlgorithm m_ptr2FuncFF
Definition dbpp_RhsPtr2FuncFlux.h:142
bool isFrictionLess() const noexcept override final
use friction
Definition dbpp_RhsPtr2FuncFlux.h:103
bool useReconstruction() const noexcept override final
use reconstruction of state variables
Definition dbpp_RhsPtr2FuncFlux.h:98
Basic algorithm to evaluate source terms (bed slope and energy slope) The Manning formula can be read...
Definition dbpp_SrcNumericalTreatment.h:31
Abstract class. "Model" of the right-hand-side terms discretization. Hold discretization scheme or al...
Definition dbpp_SweRhsAlgorithm.h:28
virtual bool useManningFormula() const noexcept
Used friction formula.
Definition dbpp_SweRhsAlgorithm.h:106
Definition DamBreakProb.h:15
Aggregate (must support operator[])
Definition dbpp_SweRhsData.hpp:17