Skip to content

Commit 9168066

Browse files
DorianGerardinArthoni
authored andcommitted
Update of hayami simulators
1 parent c0acaa8 commit 9168066

File tree

10 files changed

+74
-50
lines changed

10 files changed

+74
-50
lines changed

examples/wares-dev/simulators/water.surf.transfer-rs.hayami/src/HayamiRSSim.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class HayamiRSSimulator : public openfluid::ware::PluggableSimulator
6969

7070
float m_RSBuffer;
7171

72-
fragments::hydro::IDKernelMap m_RSKernel;
72+
fragments::math::numerical::IDKernelMap m_RSKernel;
7373

7474
bool m_UseUpSUOutput;
7575

@@ -347,8 +347,8 @@ class HayamiRSSimulator : public openfluid::ware::PluggableSimulator
347347
OPENFLUID_GetAttribute(RS,"length",RSlength);
348348
Cel = m_MeanCelerity * (m_MeanManning / RSmanning) * (sqrt((RSslope / m_MeanSlope)));
349349
Sigma = m_MeanSigma * (RSmanning/ m_MeanManning) * (m_MeanSlope / RSslope);
350-
m_RSKernel[RS->getID()] = fragments::hydro::t_HayamiKernel();
351-
fragments::hydro::ComputeHayamiKernel(Cel, Sigma,RSlength,m_MaxSteps,OPENFLUID_GetDefaultDeltaT(), m_RSKernel[RS->getID()]);
350+
m_RSKernel[RS->getID()] = fragments::math::numerical::t_HayamiKernel();
351+
fragments::math::numerical::ComputeHayamiKernel(Cel, Sigma,RSlength,m_MaxSteps,OPENFLUID_GetDefaultDeltaT(), m_RSKernel[RS->getID()]);
352352

353353
}
354354

@@ -514,7 +514,7 @@ class HayamiRSSimulator : public openfluid::ware::PluggableSimulator
514514
QOutput = 0;
515515
if (m_CurrentInputSum[ID] > 0)
516516
{
517-
QOutput = fragments::hydro::DoHayamiPropagation(m_RSKernel[ID], CurrentStep-1, m_Input[ID], m_MaxSteps, DeltaT);
517+
QOutput = fragments::math::numerical::DoHayamiPropagation(m_RSKernel[ID], CurrentStep-1, m_Input[ID], m_MaxSteps, DeltaT);
518518
}
519519

520520
OPENFLUID_AppendVariable(RS,"water.surf.Q.downstream-rs",QOutput);

examples/wares-dev/simulators/water.surf.transfer-rs.hayami/src/fragments/hayami.kernel/HayamiTools.hpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050

5151
#define _PI_ 3.1415926536
5252

53-
namespace fragments {
54-
namespace hydro { //TOIMPL double-check namespace name relevance
53+
namespace fragments { namespace math { namespace numerical {
54+
5555

5656
typedef std::vector<double> t_HayamiKernel;
5757
typedef std::map<int, t_HayamiKernel> IDKernelMap;
@@ -158,7 +158,6 @@ inline float DoHayamiPropagation(const t_HayamiKernel& Kernel,
158158
return QOutput;
159159
}
160160

161-
#endif // __HAYAMITOOLS_H__
161+
} } } //namespaces
162162

163-
}
164-
}
163+
#endif // __HAYAMITOOLS_H__

examples/wares-dev/simulators/water.surf.transfer-rs.hayami/src/fragments/hayami.kernel/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ For wave propagation
44
By Moussa R., Fabre J.-C., Louchart X., Lalauze S.
55

66

7+
## Usage
8+
Simple use example:
9+
```cpp
10+
fragments::math::numerical::ComputeHayamiKernel(...);
11+
float QOutput = fragments::math::numerical::DoHayamiPropagation(...);
12+
```
13+
14+
715
## Requirements
816
- OpenFLUID 2.2
917
- binaries directory
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
{
2-
"id": "hayami.kernel",
3-
"name": "Hayami method",
4-
"description": "diffusive wave equation resolved with Hayami method",
5-
"version": "0.1",
6-
"status": "alpha",
7-
"authors": ["Moussa R.", "Fabre J.-C.", "Louchart X.", "Lalauze S"],
8-
"contacts": [],
9-
"license": "TO BE DETERMINED",
10-
"tags":["propagation", "wave", "kernel"],
11-
"links": [],
12-
"issues" : [],
13-
"dependencies": {},
14-
"fragment": {
15-
"openfluid-components": []
16-
},
2+
"id": "hayami.kernel",
3+
"name": "Hayami method",
4+
"description": "diffusive wave equation resolved with Hayami method",
5+
"version": "0.1",
6+
"status": "alpha",
7+
"authors": [
8+
{"name": "Moussa R."},
9+
{"name": "Fabre J.-C."},
10+
{"name": "Louchart X."},
11+
{"name": "Lalauze S"}
12+
],
13+
"contacts": [],
14+
"license": "TO BE DETERMINED",
15+
"tags":["propagation", "wave", "kernel"],
16+
"links": [],
17+
"issues" : [],
18+
"dependencies": {},
19+
"fragment": {
20+
"openfluid-components": ["core"]
1721
}
22+
}
1823

examples/wares-dev/simulators/water.surf.transfer-rs.hayami/src/fragments/hayami.kernel/tests/HayamiTools_TEST.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// =====================================================================
1414
// =====================================================================
1515

16-
using namespace fragments::hydro;
16+
using namespace fragments::math::numerical;
1717

1818
const std::string TestOutputDir = "./";
1919

examples/wares-dev/simulators/water.surf.transfer-su.hayami/src/HayamiSUSim.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class HayamiSUSimulator : public openfluid::ware::PluggableSimulator
5555

5656
double m_MeanManning;
5757

58-
fragments::hydro::IDKernelMap m_SUKernel;
58+
fragments::math::numerical::IDKernelMap m_SUKernel;
5959

6060
openfluid::core::IDSerieOfDoubleValuePtrMap m_Input;
6161

@@ -243,9 +243,9 @@ class HayamiSUSimulator : public openfluid::ware::PluggableSimulator
243243
Sigma = m_MeanSigma * (TmpValue / m_MeanManning) * (m_MeanSlope / Area);
244244

245245
// Computing Hayami kernel
246-
m_SUKernel[SU->getID()] = fragments::hydro::t_HayamiKernel();
246+
m_SUKernel[SU->getID()] = fragments::math::numerical::t_HayamiKernel();
247247
OPENFLUID_GetAttribute(SU,"flowdist",TmpValue);
248-
fragments::hydro::ComputeHayamiKernel(Cel, Sigma,TmpValue,m_MaxSteps,DeltaT, m_SUKernel[SU->getID()]);
248+
fragments::math::numerical::ComputeHayamiKernel(Cel, Sigma,TmpValue,m_MaxSteps,DeltaT, m_SUKernel[SU->getID()]);
249249
}
250250

251251

@@ -350,7 +350,7 @@ class HayamiSUSimulator : public openfluid::ware::PluggableSimulator
350350
if (m_CurrentInputSum[ID] > 0)
351351
{
352352
//TODO check given CurrentStep
353-
QOutput = fragments::hydro::DoHayamiPropagation(m_SUKernel[ID], CurrentStep-1, m_Input[ID], m_MaxSteps, DeltaT);
353+
QOutput = fragments::math::numerical::DoHayamiPropagation(m_SUKernel[ID], CurrentStep-1, m_Input[ID], m_MaxSteps, DeltaT);
354354
}
355355
OPENFLUID_AppendVariable(SU,"water.surf.Q.downstream-su",QOutput);
356356

examples/wares-dev/simulators/water.surf.transfer-su.hayami/src/fragments/hayami.kernel/HayamiTools.hpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050

5151
#define _PI_ 3.1415926536
5252

53-
namespace fragments {
54-
namespace hydro { //TOIMPL double-check namespace name relevance
53+
namespace fragments { namespace math { namespace numerical {
54+
5555

5656
typedef std::vector<double> t_HayamiKernel;
5757
typedef std::map<int, t_HayamiKernel> IDKernelMap;
@@ -158,7 +158,6 @@ inline float DoHayamiPropagation(const t_HayamiKernel& Kernel,
158158
return QOutput;
159159
}
160160

161-
#endif // __HAYAMITOOLS_H__
161+
} } } //namespaces
162162

163-
}
164-
}
163+
#endif // __HAYAMITOOLS_H__

examples/wares-dev/simulators/water.surf.transfer-su.hayami/src/fragments/hayami.kernel/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ For wave propagation
44
By Moussa R., Fabre J.-C., Louchart X., Lalauze S.
55

66

7+
## Usage
8+
Simple use example:
9+
```cpp
10+
fragments::math::numerical::ComputeHayamiKernel(...);
11+
float QOutput = fragments::math::numerical::DoHayamiPropagation(...);
12+
```
13+
14+
715
## Requirements
816
- OpenFLUID 2.2
917
- binaries directory
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
{
2-
"id": "hayami.kernel",
3-
"name": "Hayami method",
4-
"description": "diffusive wave equation resolved with Hayami method",
5-
"version": "0.1",
6-
"status": "alpha",
7-
"authors": ["Moussa R.", "Fabre J.-C.", "Louchart X.", "Lalauze S"],
8-
"contacts": [],
9-
"license": "TO BE DETERMINED",
10-
"tags":["propagation", "wave", "kernel"],
11-
"links": [],
12-
"issues" : [],
13-
"dependencies": {},
14-
"fragment": {
15-
"openfluid-components": []
16-
},
2+
"id": "hayami.kernel",
3+
"name": "Hayami method",
4+
"description": "diffusive wave equation resolved with Hayami method",
5+
"version": "0.1",
6+
"status": "alpha",
7+
"authors": [
8+
{"name": "Moussa R."},
9+
{"name": "Fabre J.-C."},
10+
{"name": "Louchart X."},
11+
{"name": "Lalauze S"}
12+
],
13+
"contacts": [],
14+
"license": "TO BE DETERMINED",
15+
"tags":["propagation", "wave", "kernel"],
16+
"links": [],
17+
"issues" : [],
18+
"dependencies": {},
19+
"fragment": {
20+
"openfluid-components": ["core"]
1721
}
22+
}
1823

examples/wares-dev/simulators/water.surf.transfer-su.hayami/src/fragments/hayami.kernel/tests/HayamiTools_TEST.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// =====================================================================
1414
// =====================================================================
1515

16-
using namespace fragments::hydro;
16+
using namespace fragments::math::numerical;
1717

1818
const std::string TestOutputDir = "./";
1919

0 commit comments

Comments
 (0)