jalhyd
Version:
JaLHyd, a Javascript Library for Hydraulics
128 lines • 4.9 kB
TypeScript
import { Nub } from "../internal_modules";
import { ParamDefinition } from "../internal_modules";
import { Result } from "../internal_modules";
import { PreBarrageParams } from "../internal_modules";
import { PbBassin, IPbBassinZstat } from "../internal_modules";
import { PbCloison } from "../internal_modules";
export declare class PreBarrage extends Nub {
/** Liste des cloisons amont */
private _cloisonsAmont;
maxIterations: number;
/** Pointeurs vers les bassins dans this.children */
private _bassins;
/** Coefficient de relaxation pour la répartition des débits */
private _relax;
/** Precision du calcul (Min. 1E-4) */
private _precision;
constructor(prms: PreBarrageParams, dbg?: boolean);
/**
* paramètres castés au bon type
*/
get prms(): PreBarrageParams;
/**
* enfants castés au bon type
*/
get children(): (PbCloison | PbBassin)[];
get bassins(): PbBassin[];
get cloisonsAmont(): PbCloison[];
/**
* Removes a child, along with all features (basins or walls) that are
* related only to it, and pointers to it
*/
deleteChild(index: number): void;
/**
* Returns true if at least one path is connecting river upstream to river downstream,
* using at least one basin (direct connection without basin doesn't count)
*/
hasUpDownConnection(startWall?: PbCloison, nbBasins?: number, visited?: PbCloison[]): boolean;
/**
* Returns true if at least one basin is lacking upstream or downstream connection (or both)
*/
hasBasinNotConnected(): boolean;
/**
* Returns the child (basin or wall) having the given UID, along with its position
* among the _children array (*not* the _bassins array !)
*/
protected findChildAndPosition(uid: string): {
child: PbBassin | PbCloison;
position: number;
};
/**
* Returns the child (basin or wall) having the given UID
*/
findChild(uid: string): PbBassin | PbCloison;
/**
* Returns the position of the child (basin or wall) having the given UID,
* among the _children array (*not* the _bassins array !)
*/
findChildPosition(uid: string): number;
/**
* Returns the position of the basin having the given UID,
* among the _bassins array (*not* the _children array !)
*/
findBasinPosition(uid: string): number;
/**
* Moves the basin having the given UID, so that it becomes
* basin #newBasinNumber, by reordering _children array and
* rebuilding _bassins array afterwards
*/
moveBasin(uid: string, newBasinNumber: number): void;
/**
* Detect duplicate walls between same basins pair, and merges
* them into one wall containing all the previous walls' structures.
*/
private detectAndMergeDuplicateWalls;
/**
* Finds all walls connected to the given basin's upstream (is upstream is true) or
* downstream. Among those walls, finds those who have the same basin at their
* opposite connection and merges them into one wall.
* @param b
* @param upstream
*/
private mergeDuplicateWalls;
/**
* Given a list of walls, moves all structures belonging to
* structures #2+ into structure #1, and removes structures
* #2+ from the current PreBarrage
* @param walls
*/
private mergeStructuresInFirstWall;
/**
* Effectue une série de calculs sur un paramètre; déclenche le calcul en chaîne
* des modules en amont si nécessaire
* @param rInit solution approximative du paramètre
*/
CalcSerie(rInit?: number): Result;
Calc(sVarCalc: string, rInit?: number): Result;
/**
* Calcul de Z1 pour une valeur fixe des paramètres
* @param sVarCalc ignoré: Z1 uniquement
*/
Equation(sVarCalc: string): Result;
/**
* Checks pass geometry before calculation; adds relevant log messages
*/
protected checkGeometry(): Result;
protected setParametersCalculability(): void;
protected adjustChildParameters(child: (PbCloison | PbBassin)): void;
/** Clears basins list then builds it again fom children list */
updatePointers(): void;
private isMeshed;
private CalcQ;
CalcZ1Cloisons(cloisons: PbCloison[]): IPbBassinZstat;
getMinZDV(cloisons: PbCloison[]): number;
/**
* Fills the current Nub with parameter values, provided an object representation
* @param obj object representation of a Nub content (parameters)
* @returns the calculated parameter found, if any - used by child Nub to notify
* its parent of the calculated parameter to set
*/
loadObjectRepresentation(obj: any): {
p: ParamDefinition;
hasErrors: boolean;
changedUids: {
[key: string]: string;
};
};
}
//# sourceMappingURL=pre_barrage.d.ts.map