13#include "include/Sfx_UniversalConstants.h"
40 template<
typename T,
typename... TN>
43 static constexpr bool value = (std::is_same_v<T, TN> && ...);
56 template<
auto Sep =
' ',
typename First,
typename... Args>
57 void print17(
const First& aFirst2Print,
const Args&... aArgs)
59 std::cout << aFirst2Print;
62 auto outWithSep = [](
const auto& arg)
64 std::cout << Sep <<
"arg";
71 (... , outWithSep(aArgs)) <<
'\n';
95 using namespace std::string_literals;
97 if (aVal1 * aVal2 <= 0.)
100 else if ((std::abs(aVal1) < std::abs(aVal2)) && (aVal1 * aVal2 > 0.))
103 else if ((std::abs(aVal2) < std::abs(aVal1)) && (aVal1 * aVal2 > 0.))
106 else if (std::abs(aVal2) == std::abs(aVal1))
111 std::cerr <<
"Fonction MINMOD: situation ne correspondant pas a celle attendue\n";
112 Sfx::Logger::instance()->OutputError(
"Fonction MINMOD: situation ne correspondant pas a celle attendue"s.data());
148 const auto gNN = Sfx::cGravity<float64>*
m_N *
m_N;
149 const auto V =
Q /
A;
150 const auto Vsquaredivh = V * std::fabs(V) / ((
A *
A) * std::pow(Rh, 4. / 3.));
152 return gNN * Vsquaredivh;
186 template<
typename UnaryFunctor>
190 return std::for_each(std::begin(aSectF), std::end(aSectF), aFunctor);
198 template<
typename Range>
199 std::ranges::range_value_t<Range>
maxValue(Range&& aRng)
204 if constexpr (std::ranges::empty(aRng))
206 return std::ranges::range_value_t<Range>{};
209 auto maxValue = *std::ranges::begin(aRng);
211 for(
auto pos = std::ranges::begin(aRng);
212 pos!=std::ranges::end(aRng);++pos)
228 template<
typename CB>
243 template<
typename ...Args>
244 decltype(
auto)
operator() (Args&& ...args)
247 return m_callBack(std::forward<Args>(args)...);
List of cross-section flow (itereable)
Definition dbpp_ListSectionsFlow.h:15
Minmod limiter function for slope limiting gradient evaluation.
Definition dbpp_SimulationUtilities.hpp:89
constexpr auto operator()(T aVal1, T aVal2)
Definition dbpp_SimulationUtilities.hpp:93
long count() const
Counter.
Definition dbpp_SimulationUtilities.hpp:253
callCounter(CB aCallBack)
Ctor enables deduction of calback type as the template parameter.
Definition dbpp_SimulationUtilities.hpp:236
long m_count
Definition dbpp_SimulationUtilities.hpp:256
std::atomic_long m_parCounter
Definition dbpp_SimulationUtilities.hpp:257
CB m_callBack
Definition dbpp_SimulationUtilities.hpp:255
Definition dbpp_SimulationUtilities.hpp:78
constexpr float64 HydRadius(float64 aArea, float64 aWidth=1.)
Function specific to a rectangular channel of width B Perimeter established according to a flow area ...
Definition HydUtils.h:70
Definition DamBreakProb.h:15
@ A
Definition dbpp_Enumerations.h:16
@ Q
Definition dbpp_Enumerations.h:17
@ H
Definition dbpp_Enumerations.h:18
double float64
Definition dbpp_LDeltaOperator.h:12
constexpr float64 Evaluation_A_fonction_H(float64 H, float64 Z, float64 B=1.)
Function that evaluate wetted area in terms of section parameters (H,B,Z)
Definition dbpp_SimulationUtilities.hpp:175
decltype(auto) Evaluation_A_fonction_H14(const ListSectionsFlow &aSectF, UnaryFunctor aFunctor)
Definition dbpp_SimulationUtilities.hpp:187
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
std::ranges::range_value_t< Range > maxValue(Range &&aRng)
find maximum value of a range
Definition dbpp_SimulationUtilities.hpp:199
Check if types are identical using fold expression.
Definition dbpp_SimulationUtilities.hpp:41
static constexpr bool value
Definition dbpp_SimulationUtilities.hpp:43