Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
cassiopee
jalhyd
Commits
4e8d9050
Commit
4e8d9050
authored
Sep 11, 2019
by
Mathias Chouet
🍝
Browse files
[WIP]
#40
store precision in Session
parent
2e3cbbdb
Changes
59
Hide whitespace changes
Inline
Side-by-side
spec/fuzzing.spec.ts
View file @
4e8d9050
import
{
CalculatorType
}
from
"
../src/compute-node
"
;
import
{
Session
}
from
"
../src/index
"
;
import
{
MacrorugoCompound
}
from
"
../src/macrorugo/macrorugo_compound
"
;
import
{
Nub
}
from
"
../src/nub
"
;
import
{
CloisonAval
}
from
"
../src/pab/cloison_aval
"
;
...
...
@@ -6,7 +7,6 @@ import { Pab } from "../src/pab/pab";
import
{
ParamDefinition
}
from
"
../src/param/param-definition
"
;
import
{
Props
}
from
"
../src/props
"
;
import
{
SectionNub
}
from
"
../src/section/section_nub
"
;
import
{
Session
}
from
"
../src/session
"
;
import
{
CreateStructure
}
from
"
../src/structure/factory_structure
"
;
import
{
ParallelStructure
}
from
"
../src/structure/parallel_structure
"
;
import
{
checkResultConsistency
,
SetJasmineCurrentSpec
}
from
"
./test_func
"
;
...
...
@@ -59,16 +59,14 @@ const calTypes =
).
map
((
e
)
=>
+
e
);
function
randomizeParameter
(
p
:
ParamDefinition
)
{
if
(
p
.
symbol
!==
"
Pr
"
)
{
p
.
singleValue
=
Math
.
max
(
-
1
E
-
6
,
p
.
domain
.
minValue
)
+
Math
.
random
()
*
(
Math
.
min
(
1
E6
,
p
.
domain
.
maxValue
)
-
Math
.
max
(
-
1
E6
,
p
.
domain
.
minValue
)
);
if
(
Math
.
random
()
<
fuzzyCfg
.
propInvertedPrm
)
{
p
.
singleValue
=
1
/
p
.
currentValue
;
}
p
.
singleValue
=
Math
.
max
(
-
1
E
-
6
,
p
.
domain
.
minValue
)
+
Math
.
random
()
*
(
Math
.
min
(
1
E6
,
p
.
domain
.
maxValue
)
-
Math
.
max
(
-
1
E6
,
p
.
domain
.
minValue
)
);
if
(
Math
.
random
()
<
fuzzyCfg
.
propInvertedPrm
)
{
p
.
singleValue
=
1
/
p
.
currentValue
;
}
}
...
...
@@ -78,7 +76,7 @@ function printPrms(n: Nub): string {
s
=
"
Calc(
"
+
n
.
calculatedParam
.
symbol
+
"
)
"
;
}
for
(
const
p
of
n
.
parameterIterator
)
{
if
(
p
.
visible
&&
p
.
symbol
!==
"
Pr
"
)
{
if
(
p
.
visible
)
{
s
+=
p
.
symbol
+
"
=
"
+
p
.
currentValue
+
"
"
;
}
}
...
...
spec/iterator/param_equation.spec.ts
View file @
4e8d9050
...
...
@@ -19,15 +19,15 @@ function checkParams(pdi: IParamDefinitionIterator, symbols: string[], values: n
describe
(
"
iterator :
"
,
()
=>
{
it
(
"
ConduiteDistribParams
"
,
()
=>
{
const
peq
:
ConduiteDistribParams
=
new
ConduiteDistribParams
(
1
,
2
,
3
,
4
,
5
);
const
symbs
=
[
"
Pr
"
,
"
Q
"
,
"
D
"
,
"
J
"
,
"
Lg
"
,
"
Nu
"
];
const
vals
=
[
0.0001
,
1
,
2
,
3
,
4
,
5
];
const
symbs
=
[
"
Q
"
,
"
D
"
,
"
J
"
,
"
Lg
"
,
"
Nu
"
];
const
vals
=
[
1
,
2
,
3
,
4
,
5
];
checkParams
(
peq
.
iterator
,
symbs
,
vals
);
});
it
(
"
ParallelStructureParams 1
"
,
()
=>
{
const
peq
:
ParallelStructureParams
=
new
ParallelStructureParams
(
1
,
2
,
3
);
const
symbs
=
[
"
Pr
"
,
"
Q
"
,
"
Z1
"
,
"
Z2
"
];
const
vals
=
[
0.0001
,
1
,
2
,
3
];
const
symbs
=
[
"
Q
"
,
"
Z1
"
,
"
Z2
"
];
const
vals
=
[
1
,
2
,
3
];
checkParams
(
peq
.
iterator
,
symbs
,
vals
);
});
...
...
@@ -38,11 +38,10 @@ describe("iterator : ", () => {
const
st
:
Structure
=
CreateStructure
(
LoiDebit
.
WeirCem88d
,
pst
);
pst
.
addChild
(
st
);
// le 2e "Pr" est celui de la structure
const
symbs
=
[
"
Pr
"
,
"
Q
"
,
"
Z1
"
,
"
Z2
"
,
"
Pr
"
,
"
CdWR
"
,
"
CdGR
"
,
"
CdWSL
"
,
"
h1
"
,
"
h2
"
,
"
L
"
,
"
Q
"
,
"
W
"
,
"
Z1
"
,
"
Z2
"
,
"
ZDV
"
"
Q
"
,
"
Z1
"
,
"
Z2
"
,
"
CdWR
"
,
"
CdGR
"
,
"
CdWSL
"
,
"
h1
"
,
"
h2
"
,
"
L
"
,
"
Q
"
,
"
W
"
,
"
Z1
"
,
"
Z2
"
,
"
ZDV
"
];
const
vals
=
[
0.0001
,
1
,
2
,
3
];
const
vals
=
[
1
,
2
,
3
];
checkParams
(
pst
.
parameterIterator
,
symbs
,
vals
);
});
});
spec/macrorugo/macrorugo.spec.ts
View file @
4e8d9050
import
{
ParamCalculability
,
ParamValueMode
}
from
"
../../src/index
"
;
import
{
ParamCalculability
,
ParamValueMode
,
Session
}
from
"
../../src/index
"
;
import
{
MacroRugo
,
MacroRugoFlowType
}
from
"
../../src/macrorugo/macrorugo
"
;
import
{
MacrorugoParams
}
from
"
../../src/macrorugo/macrorugo_params
"
;
import
{
checkResult
}
from
"
../test_func
"
;
...
...
spec/macrorugo/macrorugo_compound.spec.ts
View file @
4e8d9050
...
...
@@ -3,7 +3,7 @@ import { MacroRugo } from "../../src/macrorugo/macrorugo";
import
{
MacrorugoCompound
}
from
"
../../src/macrorugo/macrorugo_compound
"
;
import
{
MacrorugoParams
}
from
"
../../src/macrorugo/macrorugo_params
"
;
import
{
Props
}
from
"
../../src/props
"
;
import
{
Session
}
from
"
../../src/
session
"
;
import
{
Session
}
from
"
../../src/
index
"
;
import
{
compareTwoResults
}
from
"
../test_func
"
;
let
BR
:
number
;
...
...
spec/pab/cloisons_jalhyd127.spec.ts
View file @
4e8d9050
import
{
Cloisons
}
from
"
../../src/pab/cloisons
"
;
import
{
Session
}
from
"
../../src/
session
"
;
import
{
Session
}
from
"
../../src/
index
"
;
export
function
getNubJalhyd127
():
Cloisons
{
const
sessionJson
=
`{
...
...
spec/pab/pab_jalhyd130.spec.ts
View file @
4e8d9050
import
{
CalculatorType
}
from
"
../../src/compute-node
"
;
import
{
Pab
}
from
"
../../src/pab/pab
"
;
import
{
Props
}
from
"
../../src/props
"
;
import
{
Session
}
from
"
../../src/
session
"
;
import
{
Session
}
from
"
../../src/
index
"
;
import
{
getNubJalhyd127
}
from
"
./cloisons_jalhyd127.spec
"
;
describe
(
"
Class Pab
"
,
()
=>
{
...
...
spec/pab/pab_jalhyd131.spec.ts
View file @
4e8d9050
import
{
BoolIdentity
}
from
"
../../src/base
"
;
import
{
Pab
}
from
"
../../src/pab/pab
"
;
import
{
Session
}
from
"
../../src/
session
"
;
import
{
Session
}
from
"
../../src/
index
"
;
function
getPabJalhyd131
():
Pab
{
const
sessionJson
=
`{
...
...
spec/pab/pab_jalhyd135.spec.ts
View file @
4e8d9050
import
{
Pab
}
from
"
../../src/pab/pab
"
;
import
{
Session
}
from
"
../../src/
session
"
;
import
{
Session
}
from
"
../../src/
index
"
;
describe
(
"
Pab
"
,
()
=>
{
describe
(
"
jalhyd#135
"
,
()
=>
{
...
...
spec/pab/pab_puissance_jalhyd132.spec.ts
View file @
4e8d9050
import
{
CalculatorType
}
from
"
../../src/compute-node
"
;
import
{
PabPuissance
}
from
"
../../src/pab/pab_puissance
"
;
import
{
Props
}
from
"
../../src/props
"
;
import
{
Session
}
from
"
../../src/
session
"
;
import
{
Session
}
from
"
../../src/
index
"
;
describe
(
"
Class PabPuissance
"
,
()
=>
{
describe
(
"
jalhyd#132
"
,
()
=>
{
...
...
spec/param/param_modes.spec.ts
View file @
4e8d9050
...
...
@@ -34,14 +34,14 @@ let prm6: ParamsSectionTrapez;
function
createEnv
()
{
// Nub 1 : Régime Uniforme
const
paramSect
=
new
ParamsSectionCirc
(
2
,
0.6613
,
40
,
1.2
,
0.001
,
1
);
paramSect
.
Pr
.
v
=
0.01
;
Session
.
getInstance
().
precision
=
0.01
;
const
sect
=
new
cSnCirc
(
paramSect
);
nub1
=
new
RegimeUniforme
(
sect
);
prm1
=
nub1
.
section
.
prms
as
ParamsSectionCirc
;
// Nub 2 : Lois d'ouvrages
prm2
=
new
ParallelStructureParams
(
0.5
,
102
,
101.5
);
prm2
.
Pr
.
v
=
0.01
;
Session
.
getInstance
().
precision
=
0.01
;
nub2
=
new
ParallelStructure
(
prm2
);
nub2
.
addChild
(
CreateStructure
(
...
...
@@ -74,7 +74,7 @@ function createEnv() {
// Nub 4 : Lois de déversoirs Dénoyés
prm4
=
new
DeverParams
(
0.5
,
102
,
10
,
99
);
prm4
.
Pr
.
v
=
0.01
;
Session
.
getInstance
().
precision
=
0.01
;
nub4
=
new
Dever
(
prm4
);
nub4
.
addChild
(
CreateStructure
(
...
...
@@ -93,7 +93,7 @@ function createEnv() {
// Nub 5 : Lois de déversoirs Dénoyés (2)
prm5
=
new
DeverParams
(
0.5
,
102
,
10
,
99
);
prm5
.
Pr
.
v
=
0.01
;
Session
.
getInstance
().
precision
=
0.01
;
nub5
=
new
Dever
(
prm5
);
nub5
.
addChild
(
CreateStructure
(
...
...
@@ -112,7 +112,7 @@ function createEnv() {
// Nub 6 : Section Paramétrée
prm6
=
new
ParamsSectionTrapez
(
1
,
0.5
,
1
,
0.01
,
1
,
0.01
,
2
);
prm6
.
Pr
.
v
=
0.01
;
Session
.
getInstance
().
precision
=
0.01
;
nub6
=
new
SectionParametree
(
new
cSnTrapez
(
prm6
));
const
prm7
=
nub6
.
prms
as
ParamsSectionTrapez
;
...
...
@@ -162,7 +162,7 @@ function testModesPermutations(nubToTest: Nub) {
// set every parameter to MINMAX / LISTE mode
let
i
=
0
;
for
(
const
p
of
nubToTest
.
parameterIterator
)
{
if
(
p
.
symbol
===
"
Pr
"
||
!
p
.
visible
)
{
if
(
!
p
.
visible
)
{
continue
;
}
if
(
i
%
2
===
0
)
{
...
...
@@ -184,7 +184,7 @@ function testModesPermutations(nubToTest: Nub) {
// set every parameter to LINK mode then to SINGLE mode
for
(
const
p
of
nubToTest
.
parameterIterator
)
{
if
(
p
.
symbol
===
"
Pr
"
||
!
p
.
visible
)
{
if
(
!
p
.
visible
)
{
continue
;
}
const
lv
:
LinkedValue
[]
=
Session
.
getInstance
().
getLinkableValues
(
p
);
...
...
spec/param/param_multivar.spec.ts
View file @
4e8d9050
...
...
@@ -442,7 +442,7 @@ describe("multiple variated parameters - ", () => {
Session
.
getInstance
().
clear
();
// session data is slightly different from #115 : upper boundaries are modified to ease values length check
// tslint:disable-next-line:max-line-length
const
sess
=
`{"header":{"source":"jalhyd","format_version":"1.0","created":"2019-06-03T12:45:20.774Z"},"session":[{"uid":"amd2OG","props":{"calcType":8,"nodeType":0},"meta":{"title":"Ouvrages"},"children":[{"uid":"YzNhaT","props":{"calcType":7,"nodeType":5,"structureType":0,"loiDebit":2},"children":[],"parameters":[{"symbol":"ZDV","mode":"LINK","targetNub":"anZjdD","targetParam":"ZDV"},{"symbol":"L","mode":"SINGLE","value":2}]}],"parameters":[{"symbol":"
Pr","mode":"SINGLE","value":0.0001},{"symbol":"
Q","mode":"LINK","targetNub":"aTgwMm","targetParam":"Q"},{"symbol":"Z1","mode":"CALCUL"},{"symbol":"Z2","mode":"MINMAX","min":100,"max":101.999,"step":0.05}]},{"uid":"aTgwMm","props":{"calcType":8,"nodeType":0},"meta":{"title":"Ouvrages 1"},"children":[{"uid":"anZjdD","props":{"calcType":7,"nodeType":5,"structureType":0,"loiDebit":8},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":100},{"symbol":"L","mode":"SINGLE","value":2},{"symbol":"alpha","mode":"SINGLE","value":0.4},{"symbol":"beta","mode":"SINGLE","value":0.001},{"symbol":"ZRAM","mode":"SINGLE","value":100}]}],"parameters":[{"symbol":"
Pr","mode":"SINGLE","value":0.0001},{"symbol":"
Q","mode":"MINMAX","min":1,"max":19.9999,"step":0.1},{"symbol":"Z1","mode":"CALCUL"},{"symbol":"Z2","mode":"SINGLE","value":101.5}]}]}`
;
const
sess
=
`{"header":{"source":"jalhyd","format_version":"1.0","created":"2019-06-03T12:45:20.774Z"},"session":[{"uid":"amd2OG","props":{"calcType":8,"nodeType":0},"meta":{"title":"Ouvrages"},"children":[{"uid":"YzNhaT","props":{"calcType":7,"nodeType":5,"structureType":0,"loiDebit":2},"children":[],"parameters":[{"symbol":"ZDV","mode":"LINK","targetNub":"anZjdD","targetParam":"ZDV"},{"symbol":"L","mode":"SINGLE","value":2}]}],"parameters":[{"symbol":"Q","mode":"LINK","targetNub":"aTgwMm","targetParam":"Q"},{"symbol":"Z1","mode":"CALCUL"},{"symbol":"Z2","mode":"MINMAX","min":100,"max":101.999,"step":0.05}]},{"uid":"aTgwMm","props":{"calcType":8,"nodeType":0},"meta":{"title":"Ouvrages 1"},"children":[{"uid":"anZjdD","props":{"calcType":7,"nodeType":5,"structureType":0,"loiDebit":8},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":100},{"symbol":"L","mode":"SINGLE","value":2},{"symbol":"alpha","mode":"SINGLE","value":0.4},{"symbol":"beta","mode":"SINGLE","value":0.001},{"symbol":"ZRAM","mode":"SINGLE","value":100}]}],"parameters":[{"symbol":"Q","mode":"MINMAX","min":1,"max":19.9999,"step":0.1},{"symbol":"Z1","mode":"CALCUL"},{"symbol":"Z2","mode":"SINGLE","value":101.5}]}]}`
;
Session
.
getInstance
().
unserialise
(
sess
);
const
ouvrages
=
Session
.
getInstance
().
findNubByUid
(
"
amd2OG
"
);
const
prmsO
=
ouvrages
.
prms
as
ParallelStructureParams
;
...
...
spec/regime_uniforme/regime_uniforme_circ.spec.ts
View file @
4e8d9050
...
...
@@ -4,6 +4,7 @@
import
{
RegimeUniforme
}
from
"
../../src/regime_uniforme
"
;
import
{
cSnCirc
}
from
"
../../src/section/section_circulaire
"
;
import
{
ParamsSectionCirc
}
from
"
../../src/section/section_circulaire_params
"
;
import
{
Session
}
from
"
../../src/index
"
;
import
{
precDist
}
from
"
../test_config
"
;
import
{
checkResult
}
from
"
../test_func
"
;
...
...
@@ -17,7 +18,7 @@ describe("Class RegimeUniforme / section circulaire :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
paramSect
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnCirc
(
paramSect
);
const
ru
=
new
RegimeUniforme
(
sect
);
...
...
@@ -32,7 +33,7 @@ describe("Class RegimeUniforme / section circulaire :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
paramSection
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnCirc
(
paramSection
);
const
ru
=
new
RegimeUniforme
(
sect
);
...
...
@@ -47,7 +48,7 @@ describe("Class RegimeUniforme / section circulaire :", () => {
undefined
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
paramSection
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnCirc
(
paramSection
);
const
ru
=
new
RegimeUniforme
(
sect
);
...
...
@@ -62,7 +63,7 @@ describe("Class RegimeUniforme / section circulaire :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
paramSection
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnCirc
(
paramSection
);
const
ru
=
new
RegimeUniforme
(
sect
);
...
...
@@ -77,7 +78,7 @@ describe("Class RegimeUniforme / section circulaire :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
paramSection
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnCirc
(
paramSection
);
const
ru
=
new
RegimeUniforme
(
sect
);
...
...
@@ -94,7 +95,7 @@ describe("Class RegimeUniforme / section circulaire :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
paramSect
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnCirc
(
paramSect
);
const
ru
=
new
RegimeUniforme
(
sect
);
...
...
@@ -109,7 +110,7 @@ describe("Class RegimeUniforme / section circulaire :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
paramSection
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnCirc
(
paramSection
);
const
ru
=
new
RegimeUniforme
(
sect
);
...
...
@@ -124,7 +125,7 @@ describe("Class RegimeUniforme / section circulaire :", () => {
undefined
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
paramSection
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnCirc
(
paramSection
);
const
ru
=
new
RegimeUniforme
(
sect
);
...
...
@@ -139,7 +140,7 @@ describe("Class RegimeUniforme / section circulaire :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
paramSection
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnCirc
(
paramSection
);
const
ru
=
new
RegimeUniforme
(
sect
);
...
...
@@ -154,7 +155,7 @@ describe("Class RegimeUniforme / section circulaire :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
paramSection
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnCirc
(
paramSection
);
const
ru
=
new
RegimeUniforme
(
sect
);
...
...
spec/regime_uniforme/regime_uniforme_puissance.spec.ts
View file @
4e8d9050
import
{
RegimeUniforme
}
from
"
../../src/regime_uniforme
"
;
import
{
cSnPuiss
}
from
"
../../src/section/section_puissance
"
;
import
{
ParamsSectionPuiss
}
from
"
../../src/section/section_puissance_params
"
;
import
{
Session
}
from
"
../../src/index
"
;
import
{
MessageCode
}
from
"
../../src/util/message
"
;
import
{
Result
}
from
"
../../src/util/result
"
;
import
{
precDist
}
from
"
../test_config
"
;
...
...
@@ -17,7 +18,7 @@ describe("Class RegimeUniforme / section puissance :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnPuiss
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
,
false
);
...
...
@@ -33,7 +34,7 @@ describe("Class RegimeUniforme / section puissance :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnPuiss
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
,
false
);
...
...
@@ -49,7 +50,7 @@ describe("Class RegimeUniforme / section puissance :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnPuiss
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
,
false
);
...
...
@@ -65,8 +66,8 @@ describe("Class RegimeUniforme / section puissance :", () => {
undefined
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
prms
.
Pr
.
v
=
0.00001
;
Session
.
getInstance
().
precision
=
precDist
;
Session
.
getInstance
().
precision
=
0.00001
;
const
sect
=
new
cSnPuiss
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
,
false
);
...
...
@@ -82,7 +83,7 @@ describe("Class RegimeUniforme / section puissance :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnPuiss
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
,
false
);
...
...
@@ -98,7 +99,7 @@ describe("Class RegimeUniforme / section puissance :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
paramCnl
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnPuiss
(
paramCnl
);
const
ru
=
new
RegimeUniforme
(
sect
,
false
);
...
...
@@ -116,7 +117,7 @@ describe("Class RegimeUniforme / section puissance :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnPuiss
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
,
false
);
...
...
@@ -134,7 +135,7 @@ describe("Class RegimeUniforme / section puissance :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnPuiss
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
,
false
);
...
...
@@ -150,7 +151,7 @@ describe("Class RegimeUniforme / section puissance :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnPuiss
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
,
false
);
...
...
@@ -166,7 +167,7 @@ describe("Class RegimeUniforme / section puissance :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnPuiss
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
,
false
);
...
...
@@ -182,7 +183,7 @@ describe("Class RegimeUniforme / section puissance :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnPuiss
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
);
ru
.
dichoStartIntervalMaxSteps
=
3
;
...
...
@@ -201,7 +202,7 @@ describe("Class RegimeUniforme / section puissance :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnPuiss
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
);
ru
.
dichoStartIntervalMaxSteps
=
1
;
...
...
@@ -220,7 +221,7 @@ describe("Class RegimeUniforme / section puissance :", () => {
undefined
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnPuiss
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
,
false
);
...
...
@@ -236,7 +237,7 @@ describe("Class RegimeUniforme / section puissance :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnPuiss
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
,
false
);
...
...
@@ -252,7 +253,7 @@ describe("Class RegimeUniforme / section puissance :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
paramCnl
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnPuiss
(
paramCnl
);
const
ru
=
new
RegimeUniforme
(
sect
,
false
);
...
...
spec/regime_uniforme/regime_uniforme_rect.spec.ts
View file @
4e8d9050
import
{
RegimeUniforme
}
from
"
../../src/regime_uniforme
"
;
import
{
cSnRectang
}
from
"
../../src/section/section_rectang
"
;
import
{
ParamsSectionRectang
}
from
"
../../src/section/section_rectang_params
"
;
import
{
Session
}
from
"
../../src/index
"
;
import
{
precDist
}
from
"
../test_config
"
;
import
{
checkResult
,
equalEpsilon
}
from
"
../test_func
"
;
import
{
checkResult
}
from
"
../test_func
"
;
describe
(
"
Class RegimeUniforme / section rectangulaire :
"
,
()
=>
{
describe
(
"
pas de débordement :
"
,
()
=>
{
...
...
@@ -17,7 +18,7 @@ describe("Class RegimeUniforme / section rectangulaire :", () => {
0.001
,
// If=pente du fond
1
,
// YB=hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnRectang
(
prms
,
false
);
const
ru
=
new
RegimeUniforme
(
sect
,
false
);
...
...
@@ -32,7 +33,7 @@ describe("Class RegimeUniforme / section rectangulaire :", () => {
0.001
,
// If=pente du fond
1
,
// YB=hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnRectang
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
);
...
...
@@ -48,7 +49,7 @@ describe("Class RegimeUniforme / section rectangulaire :", () => {
undefined
,
// If=pente du fond
1
,
// YB=hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnRectang
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
,
false
);
...
...
@@ -65,7 +66,7 @@ describe("Class RegimeUniforme / section rectangulaire :", () => {
0.001
,
// If=pente du fond
1
,
// YB=hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnRectang
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
);
...
...
@@ -81,7 +82,7 @@ describe("Class RegimeUniforme / section rectangulaire :", () => {
0.0001
,
// If=pente du fond
1.2
,
// YB=hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnRectang
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
);
...
...
@@ -97,7 +98,7 @@ describe("Class RegimeUniforme / section rectangulaire :", () => {
0.001
,
// If=pente du fond
1
,
// YB=hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnRectang
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
);
...
...
@@ -119,7 +120,7 @@ describe("Class RegimeUniforme / section rectangulaire :", () => {
0.001
,
// If=pente du fond
1
,
// YB=hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnRectang
(
prms
,
false
);
const
ru
=
new
RegimeUniforme
(
sect
,
false
);
...
...
@@ -135,7 +136,7 @@ describe("Class RegimeUniforme / section rectangulaire :", () => {
0.001
,
// If=pente du fond
1
,
// YB=hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnRectang
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
);
...
...
@@ -151,7 +152,7 @@ describe("Class RegimeUniforme / section rectangulaire :", () => {
undefined
,
// If=pente du fond
1
,
// YB=hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnRectang
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
,
false
);
...
...
@@ -168,7 +169,7 @@ describe("Class RegimeUniforme / section rectangulaire :", () => {
0.001
,
// If=pente du fond
1
,
// YB=hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnRectang
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
);
...
...
@@ -184,7 +185,7 @@ describe("Class RegimeUniforme / section rectangulaire :", () => {
0.0001
,
// If=pente du fond
1.2
,
// YB=hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnRectang
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
);
...
...
@@ -200,7 +201,7 @@ describe("Class RegimeUniforme / section rectangulaire :", () => {
0.001
,
// If=pente du fond
0.1
,
// YB=hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnRectang
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
);
...
...
spec/regime_uniforme/regime_uniforme_trapeze.spec.ts
View file @
4e8d9050
...
...
@@ -4,8 +4,9 @@
import
{
RegimeUniforme
}
from
"
../../src/regime_uniforme
"
;
import
{
cSnTrapez
}
from
"
../../src/section/section_trapez
"
;
import
{
ParamsSectionTrapez
}
from
"
../../src/section/section_trapez_params
"
;
import
{
Session
}
from
"
../../src/index
"
;
import
{
precDist
}
from
"
../test_config
"
;
import
{
checkResult
,
equalEpsilon
}
from
"
../test_func
"
;
import
{
checkResult
}
from
"
../test_func
"
;
describe
(
"
Class RegimeUniforme / section trapèze :
"
,
()
=>
{
describe
(
"
pas de débordement :
"
,
()
=>
{
...
...
@@ -18,7 +19,7 @@ describe("Class RegimeUniforme / section trapèze :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnTrapez
(
prms
);
...
...
@@ -36,7 +37,7 @@ describe("Class RegimeUniforme / section trapèze :", () => {
0.001
,
// If=pente du fond
1
,
// YB= hauteur de berge
);
prms
.
Pr
.
v
=
precDist
;
Session
.
getInstance
().
precision
=
precDist
;
const
sect
=
new
cSnTrapez
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
);
...
...
@@ -53,7 +54,7 @@ describe("Class RegimeUniforme / section trapèze :", () => {