2 include_spip(
'hyd_inc/form_section.abstract.class');
16 $this->saisies[
'c_hyd'] = array(
19 'rQ' =>array(
'debit', 1.2,
'op'),
20 'rY' =>array(
'tirant_eau', 0.8,
'op')
24 $this->saisies[
'param_calcul'] = array(
27 'rPrec' => array(
'precision',0.001,
'fop')
31 parent::__construct();
33 foreach($this->saisies as $cle=>&$fs) {
34 if(substr($cle,0,1)==
"F") {
38 $this->saisies[
'c_bief'][2] =
'cal';
45 $valeurs = parent::charger();
46 $valeurs[
'choix_section'] =
'FT';
55 $this->oSn->Reset(
true);
56 if($this->oP->rIf <= 0) {
58 $this->oLog->Add(_T(
'hydraulic:h_normale_pente_neg_nul'),
true);
60 $Qn = $this->oP->rKs*pow($this->oSn->Calc(
'R',$this->oSn->rY),2/3)*$this->oSn->Calc(
'S',$this->oSn->rY)*sqrt($this->oP->rIf);
61 spip_log(
'Calc_Qn('.$this->VarCal.
')='.$Qn,
'hydraulic',_LOG_DEBUG);
70 extract($this->data, EXTR_OVERWRITE|EXTR_REFS);
72 if(isset($ValVar) && $ValVar !=
''){
75 $this->oSn->{$ValVar} = &$i;
78 $this->oP->{$ValVar} = &$i;
82 if(!in_array($ValCal,array(
'rY',
'rQ'))) {
84 include_spip(
'hyd_inc/dichotomie.class');
85 $oDicho =
new cDichotomie($this->oLog,$this,
'Calc_Qn');
87 spip_log($ValCal,
'hydraulic',_LOG_DEBUG);
89 $this->VarCal = &$this->oSn->{$ValCal};
92 $this->VarCal = &$this->oP->{$ValCal};
98 for($i = $min; $i < $max; $i+= $pas){
99 spip_log(
"min=$min max=$max i=$i",
'hydraulic',_LOG_DEBUG);
104 $tRes[] = $this->oSn->Calc(
'Yn');
110 if(end($tRes)!==
false) {
117 list($tRes[],$flag) = $oDicho->calculer($rQ,$rPrec,$rInit);
120 return array(
'abs'=>$tAbs,
'res'=>$tRes);