DamBreak++ Wave Simulator 0.3
DamBreak++ Simulation Framework
Loading...
Searching...
No Matches
Sfx_LDeltaOperator.h
Go to the documentation of this file.
1#pragma once
2
3// C++ include
4#include <cmath>
5#include <vector>
6#include <valarray>
7// boost includes
8#include <boost/numeric/ublas/vector.hpp>
9// BaseNumTypes lib
10#include "Sfx/Sfx_FieldLattice.h"
11// SfxBase15 package include
12#include "include/Sfx_HOperator.h"
13// Physics algo includes
16
17// forward declarations
18namespace Sfx {
19 class PhysicalSystem;
20 class EMcNeilBndCnd;
21}
22namespace dbpp { class SweRhsAlgorithm; }
23
24namespace Sfx
25{
33 class LDeltaOperator : public Sfx::HOperator
34 {
35 public:
39 using ListSectFlowPtr = std::shared_ptr<Testvs19::ListSectionsFlow<dbpp::SectionFlow>>;
40 static constexpr int32 DIM = 100;
41 // just testing new implementation
42 // template<typename NumContType = std::valarray<double>>
43// using NumArrayTypetest = NumContType;
44 using uvec64 = boost::numeric::ublas::vector<float64>;
48 using CalculFF = void(*)( NumArrayType& aFF1, NumArrayType& aFF2,
49 const NumArrayType& aU1, const NumArrayType& aU2);
50 public:
62 public:
73
76 enum class eSourceTermType
77 {
80 };
81
90
98
106// enum class eENOStencil
107// {
108// central=0,
109// ENO=1
110// };
121
124 enum class eFluxDxType
125 {
128 };
132// typedef eBcType bounddiscr;
133 public:
147 LDeltaOperator( const LDeltaOperator& aOther)=delete;
153 LDeltaOperator& operator= ( const LDeltaOperator& aOther)=delete;
154 // what about move semantic?
159 LDeltaOperator( CalculFF aFluxDiscr);
170 void* applyTo( std::shared_ptr<Sfx::FieldLattice>& aU1,
171 std::shared_ptr<Sfx::FieldLattice>& aU2) override;
178 void* applyTo( const Sfx::FieldLattice& aU1, const Sfx::FieldLattice& aU2);
182 void solveFor() override {/*no implementation*/ }
187 eNumArrayType arrayType() const noexcept { return m_arrType;}
192 void setArrayType( const eNumArrayType aType) noexcept {m_arrType=aType;}
197 bool haspressureTerm() const noexcept { return false;}
203 bool useFriction() const noexcept { return false;}
209 void setTraitementS2( const eSourceTermType aSdx) noexcept
210 {
211 m_sourceType=aSdx;
212 }
213
218 void setDxSourceTerm( const sourcediscr aSdx) noexcept
219 {
220 m_sourceDxType=aSdx;
221 }
222
227 void setTraitementF( const dx_f aDxF) noexcept
228 {
229 m_dxfType=aDxF;
230 }
231
235 void setDerivativType( eDxSchemeType aDerivType) noexcept { m_derivativeType = aDerivType; }
241 void setD1xBCAtBothEnd(eDerivBCType aBCtype) noexcept { m_bcBothEnd = aBCtype; }
246 eDerivBCType getD1xBCtype() const noexcept { return m_bcBothEnd; }
252 void setSrcTermRhsData( const ListSectFlowPtr& aSrcData) noexcept
253 {
254 m_srcTreatmentData=aSrcData;
255 }
256
261 void setFluxAlgorithm( CalculFF aConvF) noexcept { m_calculFF = aConvF; }
266 CalculFF getFluxAlgorithm() noexcept { return m_calculFF; }
267 private:
275 //ArrayType m_H; /**< water level (H)*/ //???? what for
280 };
281} // End of namespace
std::valarray< float64 > NumArrayType
Definition SimulationConfig.h:24
Calculate the characteristic information to set boundary node values (A,Q,H)
Definition Sfx_ImposeBnd.h:22
eDxSchemeType getderivativeType() const noexcept
Definition Sfx_LDeltaOperator.h:236
eFluxDxType dx_f
Definition Sfx_LDeltaOperator.h:131
eFluxDxType m_dxfType
Definition Sfx_LDeltaOperator.h:273
void setTraitementS2(const eSourceTermType aSdx) noexcept
Set type of treatment to evaluate source term (bed slope)
Definition Sfx_LDeltaOperator.h:209
LDeltaOperator & operator=(const LDeltaOperator &aOther)=delete
assign operator
static constexpr int32 DIM
Definition Sfx_LDeltaOperator.h:40
eDerivBCType getD1xBCtype() const noexcept
Getter.
Definition Sfx_LDeltaOperator.h:246
eSourceTermType
Definition Sfx_LDeltaOperator.h:77
@ Zderivative
Definition Sfx_LDeltaOperator.h:79
@ Hderivative
Definition Sfx_LDeltaOperator.h:78
eSourceTermType m_sourceType
Definition Sfx_LDeltaOperator.h:272
CalculFF m_calculFF
Definition Sfx_LDeltaOperator.h:276
void setDxSourceTerm(const sourcediscr aSdx) noexcept
Set derivative order of bed slope term.
Definition Sfx_LDeltaOperator.h:218
eNumArrayType m_arrType
Definition Sfx_LDeltaOperator.h:268
eNumArrayType arrayType() const noexcept
Getter.
Definition Sfx_LDeltaOperator.h:187
boost::numeric::ublas::vector< float64 > uvec64
Definition Sfx_LDeltaOperator.h:44
eDxSchemeType m_derivativeType
Definition Sfx_LDeltaOperator.h:270
bool haspressureTerm() const noexcept
taking account pressure term in numerical model
Definition Sfx_LDeltaOperator.h:197
SWE_RHS * theRhs
Definition Sfx_LDeltaOperator.h:279
void setArrayType(const eNumArrayType aType) noexcept
Set type of numerical array.
Definition Sfx_LDeltaOperator.h:192
~LDeltaOperator()
dtor
Definition Sfx_LDeltaOperator.cpp:107
void solveFor() override
apply rhs discretization
Definition Sfx_LDeltaOperator.h:182
void setD1xBCAtBothEnd(eDerivBCType aBCtype) noexcept
Definition Sfx_LDeltaOperator.h:241
eSourceDxType m_sourceDxType
Definition Sfx_LDeltaOperator.h:269
void setTraitementF(const dx_f aDxF) noexcept
numerical flux evaluation
Definition Sfx_LDeltaOperator.h:227
eSourceDxType
Source term derivative order.
Definition Sfx_LDeltaOperator.h:86
@ central_4thorder
Definition Sfx_LDeltaOperator.h:88
@ central_2ndorder
Definition Sfx_LDeltaOperator.h:87
eSourceDxType sourcediscr
Definition Sfx_LDeltaOperator.h:129
void setSrcTermRhsData(const ListSectFlowPtr &aSrcData) noexcept
Some data to compute rhs.
Definition Sfx_LDeltaOperator.h:252
eDerivBCType
Derivative boundary condition (order)
Definition Sfx_LDeltaOperator.h:102
@ emcil_2nd_order
Definition Sfx_LDeltaOperator.h:104
@ noncentered_2ndorder
Definition Sfx_LDeltaOperator.h:103
LDeltaOperator()
default ctor
Definition Sfx_LDeltaOperator.cpp:53
eSourceTermType sourceTerm
Definition Sfx_LDeltaOperator.h:130
LDeltaOperator(const LDeltaOperator &aOther)=delete
copy ctor
void setDerivativType(eDxSchemeType aDerivType) noexcept
Definition Sfx_LDeltaOperator.h:235
void setFluxAlgorithm(CalculFF aConvF) noexcept
Set the convective numerical algorithm (ptr-2-function)
Definition Sfx_LDeltaOperator.h:261
dbpp::SweRhsAlgorithm * m_rhsDiscr
Definition Sfx_LDeltaOperator.h:277
CalculFF getFluxAlgorithm() noexcept
Numerical flux algorithm.
Definition Sfx_LDeltaOperator.h:266
eDxSchemeType
Derivative order.
Definition Sfx_LDeltaOperator.h:94
eNumArrayType
Numerical array type for fast floating point operation.
Definition Sfx_LDeltaOperator.h:67
@ swe_NumArray
Definition Sfx_LDeltaOperator.h:70
@ ublas_vector
Definition Sfx_LDeltaOperator.h:71
@ std_valarray
Definition Sfx_LDeltaOperator.h:68
@ std_vector
Definition Sfx_LDeltaOperator.h:69
std::shared_ptr< Testvs19::ListSectionsFlow< dbpp::SectionFlow > > ListSectFlowPtr
alias (List of section pointer)
Definition Sfx_LDeltaOperator.h:39
eDerivBCType m_bcBothEnd
Definition Sfx_LDeltaOperator.h:271
bool useFriction() const noexcept
friction ON/OFF
Definition Sfx_LDeltaOperator.h:203
eFluxType m_fluxSchme
Definition Sfx_LDeltaOperator.h:274
ListSectFlowPtr m_srcTreatmentData
Definition Sfx_LDeltaOperator.h:278
eFluxType
flux discretization
Definition Sfx_LDeltaOperator.h:116
@ convective
Definition Sfx_LDeltaOperator.h:117
@ conv_pressure
Definition Sfx_LDeltaOperator.h:119
@ pressure
Definition Sfx_LDeltaOperator.h:118
void * applyTo(std::shared_ptr< Sfx::FieldLattice > &aU1, std::shared_ptr< Sfx::FieldLattice > &aU2) override
Apply rhs discretization to each term.
Definition Sfx_LDeltaOperator.cpp:162
eFluxDxType
flux derivative type
Definition Sfx_LDeltaOperator.h:125
@ upwind_1st
Definition Sfx_LDeltaOperator.h:126
@ upwind_2nd
Definition Sfx_LDeltaOperator.h:127
void(*)(NumArrayType &aFF1, NumArrayType &aFF2, const NumArrayType &aU1, const NumArrayType &aU2) CalculFF
Pointer-to-function (numerical flux algorithm)
Definition Sfx_LDeltaOperator.h:48
Abstract class. "Model" of the right-hand-side terms discretization. Hold discretization scheme or al...
Definition dbpp_SweRhsAlgorithm.h:28
Definition HydUtils.h:15
Definition DamBreakProb.h:15
Data structure RHS terms.
Definition Sfx_LDeltaOperator.h:55
NumArrayType m_P2
Definition Sfx_LDeltaOperator.h:58
NumArrayType m_FF1
Definition Sfx_LDeltaOperator.h:56
NumArrayType m_S
Definition Sfx_LDeltaOperator.h:60
NumArrayType m_PF2
Definition Sfx_LDeltaOperator.h:59
NumArrayType m_FF2
Definition Sfx_LDeltaOperator.h:57