DamBreak++ Wave Simulator 0.3
DamBreak++ Simulation Framework
Loading...
Searching...
No Matches
dbpp_SectionFlow.h
Go to the documentation of this file.
1#pragma once
2
3// C++ include
4#include <iostream>
5// SfxBase19 lib include
6#include "include/Sfx_DefineTypes.h"
7
8namespace dbpp
9{
10 //TODO: merge this class with Hyd_SectionFlow of the Swe package
11
16 {
17 public:
21 enum class eSectionType {
27 SectionFlow() = default;
35 constexpr SectionFlow(uint32 aId, float64 aX, eSectionType aType = eSectionType::unitwidth)
36 : m_id{ aId },
37 m_x{ aX },
38 m_d{},
39 m_H{},
40 m_Z{},
41 m_N{},
42 m_B{1.},
43 m_S0am{},
44 m_S0av{},
45 m_type{aType}
46 {}
47
54 constexpr SectionFlow( uint32 aId, float64 aX, float64 aH, float64 d = 0., float64 aZ = 0.) noexcept
55 : m_id{aId},
56 m_x{aX},
57 m_d{d},
58 m_H{aH},
59 m_Z{aZ},
60 m_N{0.},
61 m_B{1.},
62 m_S0am{},
63 m_S0av{},
64 m_type{ eSectionType ::unitwidth }
65 {}
66 // default implementation
67 // constexpr eSectionType getSectionType() const { return eSectionType::unit; }
72 constexpr bool isUnitWidth() const noexcept { return m_B==1.; }
77 constexpr bool isFrictionLess() const noexcept { return m_N==0.; }
82 constexpr bool isFlatBottom() const noexcept { return m_Z==0.; }
87 constexpr float64 X() const noexcept { return m_x; }
92 constexpr float64 Z() const noexcept { return m_Z; }
97 constexpr float64 H() const noexcept { return m_H; }
102 constexpr float64 N() const noexcept { return m_N; }
107 constexpr float64 B() const noexcept { return m_B; }
112 constexpr float64 getS0am() const noexcept { return m_S0am; }
117 constexpr float64 getS0av() const noexcept { return m_S0av; }
122 constexpr unsigned getId() const noexcept { return m_id; }
128 eSectionType getType() const noexcept { return m_type; } //?? what for???
133 constexpr eSectionType getSectionType() const noexcept { return m_type; }
138 constexpr void setH(float64 aH) noexcept { m_H = aH; }
143 constexpr void setN(float64 aN) noexcept { m_N = aN; }
148 constexpr void setZ(float64 aZ) noexcept { m_Z = aZ; }
153 constexpr void setB(float64 aB) noexcept { m_B = aB; } //?? really?
157 constexpr void setSectionUnitWidth() noexcept { m_B = 1.; } //??
163 auto operator== (const SectionFlow& aOther) const
164 {
165 return (m_x == aOther.m_x) && (m_id == aOther.m_id);
166 }
167
172 auto operator<=> (const SectionFlow& aOther) const
173 {
174 return m_x < aOther.m_x ? std::strong_ordering::less :
175 std::strong_ordering::greater;
176 }
177
180 void printSectionInfo() const
181 {
182 // print some of the section parameters for debugging purpose
183 std::cout << "Section id :" << m_id << " " << "X: " << m_x << " " << "Z: " << m_Z << " " << "H: "
184 << m_H << " " << "N: " << m_N << " " << "B: " << m_B << " " << "S0am: " << m_S0am << " "
185 << "S0av: " << m_S0av << "\n";
186 }
187 private:
188 unsigned m_id;
198 };
199} // End of namespace
auto operator<=>(const SectionFlow &aOther) const
comparison operator (all other operators such: <,>,<=,>=)
Definition dbpp_SectionFlow.h:172
constexpr float64 getS0av() const noexcept
Getter.
Definition dbpp_SectionFlow.h:117
SectionFlow()=default
default ctor
eSectionType
Section flow geometry.
Definition dbpp_SectionFlow.h:21
@ unitwidth
Definition dbpp_SectionFlow.h:22
@ rectangular
Definition dbpp_SectionFlow.h:23
float64 m_N
Definition dbpp_SectionFlow.h:193
float64 m_S0av
Definition dbpp_SectionFlow.h:196
constexpr SectionFlow(uint32 aId, float64 aX, eSectionType aType=eSectionType::unitwidth)
set most of the section hydraulic parameters to default value such N=0,B=1,Z=0
Definition dbpp_SectionFlow.h:35
float64 m_Z
Definition dbpp_SectionFlow.h:191
float64 m_x
Definition dbpp_SectionFlow.h:189
float64 m_d
Definition dbpp_SectionFlow.h:190
constexpr float64 getS0am() const noexcept
Getter.
Definition dbpp_SectionFlow.h:112
constexpr void setZ(float64 aZ) noexcept
Setter.
Definition dbpp_SectionFlow.h:148
constexpr void setSectionUnitWidth() noexcept
Setter.
Definition dbpp_SectionFlow.h:157
constexpr void setH(float64 aH) noexcept
Setter.
Definition dbpp_SectionFlow.h:138
constexpr float64 H() const noexcept
Getter.
Definition dbpp_SectionFlow.h:97
constexpr bool isUnitWidth() const noexcept
Check unit width.
Definition dbpp_SectionFlow.h:72
constexpr float64 Z() const noexcept
Getter.
Definition dbpp_SectionFlow.h:92
constexpr void setN(float64 aN) noexcept
Setter.
Definition dbpp_SectionFlow.h:143
constexpr float64 N() const noexcept
Gdetter.
Definition dbpp_SectionFlow.h:102
float64 m_B
Definition dbpp_SectionFlow.h:194
unsigned m_id
Definition dbpp_SectionFlow.h:188
void printSectionInfo() const
/ want to use it with mem_fn
Definition dbpp_SectionFlow.h:180
constexpr SectionFlow(uint32 aId, float64 aX, float64 aH, float64 d=0., float64 aZ=0.) noexcept
Check older version for description (coming) VS15 project.
Definition dbpp_SectionFlow.h:54
eSectionType m_type
Definition dbpp_SectionFlow.h:197
float64 m_S0am
Definition dbpp_SectionFlow.h:195
eSectionType getType() const noexcept
Getter.
Definition dbpp_SectionFlow.h:128
constexpr float64 B() const noexcept
Getter.
Definition dbpp_SectionFlow.h:107
float64 m_H
Definition dbpp_SectionFlow.h:192
constexpr float64 X() const noexcept
Getter.
Definition dbpp_SectionFlow.h:87
constexpr void setB(float64 aB) noexcept
Setter.
Definition dbpp_SectionFlow.h:153
auto operator==(const SectionFlow &aOther) const
comparison operator ==, !=(generated)
Definition dbpp_SectionFlow.h:163
constexpr bool isFlatBottom() const noexcept
Check section bottom type.
Definition dbpp_SectionFlow.h:82
constexpr unsigned getId() const noexcept
Getter.
Definition dbpp_SectionFlow.h:122
constexpr eSectionType getSectionType() const noexcept
Getter.
Definition dbpp_SectionFlow.h:133
constexpr bool isFrictionLess() const noexcept
Check friction.
Definition dbpp_SectionFlow.h:77
Definition DamBreakProb.h:15
double float64
Definition dbpp_LDeltaOperator.h:12