Commit 967b26ab authored by Dorchies David's avatar Dorchies David
Browse files

fix(prebarrage): Warning on non convergence instead of error

Fix #275
parent 11a9ac1a
......@@ -301,6 +301,7 @@ export class PreBarrage extends Nub {
}
let iter: number = this.maxIterations;
let bConverged;
let z1stat: IPbBassinZstat;
// const tZ1: IPbBassinZstat[] = [];
// const tQ: number[][] = [];
while (iter-- > 0) {
......@@ -328,7 +329,7 @@ export class PreBarrage extends Nub {
bConverged = bConverged && (zStat.max - zStat.min) < this._precision;
}
this.debug("Cloison amont");
const z1stat = this.CalcZ1Cloisons(this.cloisonsAmont);
z1stat = this.CalcZ1Cloisons(this.cloisonsAmont);
this.prms.Z1.v = z1stat.moy;
// tZ1.push(z1stat);
bConverged = bConverged && (z1stat.max - z1stat.min) < this._precision
......@@ -340,8 +341,8 @@ export class PreBarrage extends Nub {
// console.debug(tZ1);
const r = new Result(this.prms.Z1.v);
if(!bConverged) {
r.resultElement.addMessage(new Message(MessageCode.ERROR_PREBARRAGE_NON_CONVERGENCE, {
lastApproximation: this.prms.Z1.v
r.resultElement.addMessage(new Message(MessageCode.WARNING_PREBARRAGE_NON_CONVERGENCE, {
precision: (z1stat.max - z1stat.min)
}));
}
return r;
......
......@@ -662,7 +662,7 @@ export enum MessageCode {
/**
* Pré-barrage : non convergence du calcul
*/
ERROR_PREBARRAGE_NON_CONVERGENCE,
WARNING_PREBARRAGE_NON_CONVERGENCE,
/** Pré-barrage : cote de l'eau aval supérieure à la cote de l'eau amont */
ERROR_PREBARRAGE_Z2_SUP_Z1,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment