11#include "include/Sfx_StateVector.h"
12#include "include/Sfx_StateVariables.h"
13#include "include/Sfx_cellFaceVariables.h"
67 using mapcellfaceVar = std::map<
short, std::pair<Sfx::StateVector, Sfx::StateVector>>;
93 template<std::ranges::contiguous_range Range>
95 Range&& aA, Range&& aQ)
98 assert(std::ranges::size(aA) == Sfx::DIM::value + 1);
99 assert(std::ranges::size(aA)==std::ranges::size(aQ));
108 static_assert(std::is_same_v<Range, std::vector<float64>>);
112 if constexpr (!std::is_same_v<Range, std::vector<float64>>)
115 if (
auto&& node = w_gnode.front(); node.isTiedNode())
118 aA[node.nodeNo()] = std::get<dbpp::toEnumType(A)>(
m_upstreamBC.Values());
119 aQ[node.nodeNo()] = std::get<dbpp::toEnumType(Q)>(
m_upstreamBC.Values());
121 if (
auto&& node = w_gnode.back(); node.isGhostNode())
123 aA[node.nodeNo()] = std::get<dbpp::toEnumType(A)>(
m_downstreamBC.Values());
124 aQ[node.nodeNo()] = std::get<dbpp::toEnumType(Q)>(
m_downstreamBC.Values());
139 std::list<Sfx::cellFaceVariables> w_listReconstrVar;
143 auto begListFaces = w_omegaGlbFaces.begin();
149 if( w_gnode.isTiedNode() && !w_gnode.isGhostNode())
156 const cellFace& w_cFace = *begListFaces++;
168 w_listReconstrVar.push_back( Sfx::cellFaceVariables(w_cFace.
getGblFaceI(),
169 Sfx::StateVector{ static_cast<float64>(Sfx::StateVariables{ aA[w_leftIdxNode] + 0.5 * w_dA[w_leftIdxNode]}),
170 static_cast<float64>(Sfx::StateVariables{ aQ[w_leftIdxNode] + 0.5 * w_dQ[w_leftIdxNode] }) },
171 Sfx::StateVector{
static_cast<float64>(Sfx::StateVariables{ aA[w_rightIdxNode] - 0.5 * w_dA[w_rightIdxNode]}),
172 static_cast<float64>(Sfx::StateVariables{ aQ[w_rightIdxNode] - 0.5 * w_dQ[w_rightIdxNode]}) }
176 return w_listReconstrVar;
188 virtual std::vector<Sfx::cellFaceVariables>
reconstr(
const Sfx::StateVectorField& aU,
189 const std::shared_ptr<FiniteVolumeDiscretization>& aGblDiscr)
193 std::vector<float64> U1vec(std::ranges::begin(aU.Avalues()), std::ranges::end(aU.Avalues()));
194 std::vector<float64> U2vec(std::ranges::begin(aU.Qvalues()), std::ranges::end(aU.Qvalues()));
200 const auto& w_uh = aGblDiscr->U_h();
201 const auto& arrayNodal = w_uh.vecNodalVarArray().front();
214 std::vector<Sfx::cellFaceVariables> w_retVarReconstr;
216 w_retVarReconstr.reserve(aGblDiscr->Omega_e().getGblFaces().size());
220 for (
const auto& w_cellFace : aGblDiscr->Omega_e().getGblFaces())
223 auto U1L = U1vec[w_cellFace.getLeftNodeI()] + 0.5 * dU1vec[w_cellFace.getLeftNodeI()];
224 auto U2L = U2vec[w_cellFace.getLeftNodeI()] + 0.5 * dU2vec[w_cellFace.getLeftNodeI()];
227 auto U1R = U1vec[w_cellFace.getRightNodeI()] - 0.5 * dU1vec[w_cellFace.getRightNodeI()];
228 auto U2R = U2vec[w_cellFace.getRightNodeI()] - 0.5 * dU2vec[w_cellFace.getRightNodeI()];
231 w_retVarReconstr.push_back(Sfx::cellFaceVariables{
static_cast<unsigned>(w_cellFace.getGblFaceI()),
232 Sfx::StateVector{ U1L,U2L }, Sfx::StateVector{ U1R,U2R } });
235 return w_retVarReconstr;
dbpp::NodalTpl< unsigned, float64, float64, float64 > PhyBCNdlConstraint
Physics computational domain (phenomena take place: half-open as default)
Definition SimulationConfig.h:39
short getReconstrVariableOrder() const
Definition dbpp_MUSCLReconstr.hpp:88
void setSlopeLimiter(slopeLimiterFunc aSlopeLimiterFunc)
Definition dbpp_MUSCLReconstr.hpp:82
std::function< float64(float64, float64)> slopeLimiterFunc
Definition dbpp_MUSCLReconstr.hpp:65
PhyBCNdlConstraint m_upstreamBC
Definition dbpp_MUSCLReconstr.hpp:240
void setPhysicalBndCnd()
Definition dbpp_MUSCLReconstr.hpp:89
std::list< Sfx::cellFaceVariables > reconstr(const dbpp::Omega &aOmega, Range &&aA, Range &&aQ)
Definition dbpp_MUSCLReconstr.hpp:94
void setFaceVariableOrder(short aOrder)
Definition dbpp_MUSCLReconstr.hpp:79
PhyBCNdlConstraint m_downstreamBC
Definition dbpp_MUSCLReconstr.hpp:241
std::map< short, std::pair< Sfx::StateVector, Sfx::StateVector > > mapcellfaceVar
Definition dbpp_MUSCLReconstr.hpp:67
short m_faceVarOrder
Definition dbpp_MUSCLReconstr.hpp:239
void setPhysicalBC(const dbpp::PhysicalBoundaryCnd &aPhysBC)
Definition dbpp_MUSCLReconstr.hpp:180
short CellId
Definition dbpp_MUSCLReconstr.hpp:62
short getDUOrder() const
Definition dbpp_MUSCLReconstr.hpp:84
virtual std::vector< Sfx::cellFaceVariables > reconstr(const Sfx::StateVectorField &aU, const std::shared_ptr< FiniteVolumeDiscretization > &aGblDiscr)
Definition dbpp_MUSCLReconstr.hpp:188
void setReconstrVariableOrder(short aVarOrder)
Definition dbpp_MUSCLReconstr.hpp:87
short m_dUOrder
Definition dbpp_MUSCLReconstr.hpp:238
void setDUOrder(short aDUOrder)
Definition dbpp_MUSCLReconstr.hpp:83
MUSCLReconstr(slopeLimiterFunc aFunction, unsigned aOrder)
Definition dbpp_MUSCLReconstr.hpp:74
Minmod limiter function for slope limiting gradient evaluation.
Definition dbpp_SimulationUtilities.hpp:89
Global Domain (part of global discretization) list of elements and geomeric nodes used by numerical m...
Definition dbpp_Omega.h:19
const std::list< cellFace > & getGblFaces() const
list of global cell faces
Definition dbpp_Omega.h:73
vec_Gnode & omega_gnode()
Nodal geometric nodes.
Definition dbpp_Omega.h:63
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
Cell face in the finite volume discretization Usage: caculFF(const cellFace& aFace) compute the numer...
Definition dbpp_CellFace.h:29
constexpr signed short getRightNodeI() const noexcept
right node neighbour
Definition dbpp_CellFace.h:63
constexpr short getLeftNodeI() const noexcept
left node neighbour
Definition dbpp_CellFace.h:58
constexpr signed short getGblFaceI() const noexcept
global face
Definition dbpp_CellFace.h:68
auto computeDU(Range aRng, FuncLimiter &&aFuncLimiter)
Compute gradient over cell by applying a slope limiter function. Range aRng Range of values (computat...
Definition Sfx_MathFunctions.hpp:119
Definition DamBreakProb.h:15
double float64
Definition dbpp_LDeltaOperator.h:12
eNodalField
Definition dbpp_Enumerations.h:24