diff --git a/src/dichotomie.ts b/src/dichotomie.ts index e748417c9db1e3c3087721f151f988710ecdbbeb..140cc546a3709eada09cd63a8d35701d005081b5 100644 --- a/src/dichotomie.ts +++ b/src/dichotomie.ts @@ -73,7 +73,7 @@ export class Dichotomie extends Debug { this._startIntervalMaxSteps = n; } - public static get inDico(): boolean { + public static get inDicho(): boolean { return Dichotomie._inDicho > 0; } diff --git a/src/prebarrage/pre_barrage.ts b/src/prebarrage/pre_barrage.ts index cf57be9ef09b27fff89366aa3528dac4b5bb331a..db12533500a68db07583abc6a3635c88aa321728 100644 --- a/src/prebarrage/pre_barrage.ts +++ b/src/prebarrage/pre_barrage.ts @@ -1,4 +1,4 @@ -import { Nub } from "../internal_modules"; +import { Nub, Structure } from "../internal_modules"; import { ParamCalculability, ParamDefinition } from "../internal_modules"; import { Result } from "../internal_modules"; import { PreBarrageParams } from "../internal_modules"; @@ -333,7 +333,18 @@ export class PreBarrage extends Nub { return this.result; } + for (const c of this._children) { + if (c instanceof PbCloison) { + c.inhibitSubmergenceError = true; + } + } const res = super.Calc(sVarCalc, rInit); + for (const c of this._children) { + if (c instanceof PbCloison) { + c.inhibitSubmergenceError = false; + } + } + // calculate basins so that they have a proper .result for (const b of this._bassins) { b.Calc(); diff --git a/src/structure/structure.ts b/src/structure/structure.ts index 763bcb45066d8df048482746af84f5892ac37781..7cb91b8cf4c57d00f55a34b7ae191ba5faaa83bc 100644 --- a/src/structure/structure.ts +++ b/src/structure/structure.ts @@ -83,7 +83,7 @@ export abstract class Structure extends ChildNub { */ protected checkSubmergenceMin(res: Result, min: number) { // on fait le test si on est pas dans un calcul par dichotomie - if (!Dichotomie.inDico && !(this.parent as ParallelStructure)?.inhibitSubmergenceError) { + if (!Dichotomie.inDicho && !(this.parent as ParallelStructure)?.inhibitSubmergenceError) { const h2h1ratio = this.prms.h2.v / this.prms.h1.v; if (h2h1ratio < min) { res.resultElement.addMessage(new Message(