diff --git a/src/solver/hydro/daily/h2o_j_fonctions.h b/src/solver/hydro/daily/h2o_j_fonctions.h index 2be835dc3e..5614e98d12 100644 --- a/src/solver/hydro/daily/h2o_j_fonctions.h +++ b/src/solver/hydro/daily/h2o_j_fonctions.h @@ -28,7 +28,7 @@ #ifndef __SOLVER_H2O_J_FONCTIONS__ #define __SOLVER_H2O_J_FONCTIONS__ -DONNEES_MENSUELLES H2O_J_Instanciation(void); +DONNEES_MENSUELLES* H2O_J_Instanciation(void); void H2O_J_OptimiserUnMois(DONNEES_MENSUELLES*); void H2O_J_Free(DONNEES_MENSUELLES*); diff --git a/src/solver/hydro/daily/h2o_j_instanciation.cpp b/src/solver/hydro/daily/h2o_j_instanciation.cpp index fa0ecf5fa7..4824e7a545 100644 --- a/src/solver/hydro/daily/h2o_j_instanciation.cpp +++ b/src/solver/hydro/daily/h2o_j_instanciation.cpp @@ -28,11 +28,11 @@ #include "h2o_j_donnees_mensuelles.h" #include "h2o_j_fonctions.h" -DONNEES_MENSUELLES H2O_J_Instanciation(void) +DONNEES_MENSUELLES* H2O_J_Instanciation(void) { - DONNEES_MENSUELLES DonneesMensuelles; + DONNEES_MENSUELLES* DonneesMensuelles = new DONNEES_MENSUELLES;; - PROBLEME_HYDRAULIQUE& ProblemeHydraulique = DonneesMensuelles.ProblemeHydraulique; + PROBLEME_HYDRAULIQUE& ProblemeHydraulique = DonneesMensuelles->ProblemeHydraulique; ProblemeHydraulique.NombreDeProblemes = 4; @@ -44,10 +44,10 @@ DONNEES_MENSUELLES H2O_J_Instanciation(void) NbJoursDUnProbleme[2] = 30; NbJoursDUnProbleme[3] = 31; - DonneesMensuelles.TurbineMax.assign(NbJoursDUnProbleme[3], 0.); - DonneesMensuelles.TurbineMin.assign(NbJoursDUnProbleme[3], 0.); - DonneesMensuelles.TurbineCible.assign(NbJoursDUnProbleme[3], 0.); - DonneesMensuelles.Turbine.assign(NbJoursDUnProbleme[3], 0.); + DonneesMensuelles->TurbineMax.assign(NbJoursDUnProbleme[3], 0.); + DonneesMensuelles->TurbineMin.assign(NbJoursDUnProbleme[3], 0.); + DonneesMensuelles->TurbineCible.assign(NbJoursDUnProbleme[3], 0.); + DonneesMensuelles->Turbine.assign(NbJoursDUnProbleme[3], 0.); int NombreDeProblemes = ProblemeHydraulique.NombreDeProblemes; diff --git a/src/solver/hydro/management/daily.cpp b/src/solver/hydro/management/daily.cpp index 3650be78e1..25aa8116e4 100644 --- a/src/solver/hydro/management/daily.cpp +++ b/src/solver/hydro/management/daily.cpp @@ -391,7 +391,7 @@ inline void HydroManagement::prepareDailyOptimalGenerations(Solver::Variable::St uint firstDay = study.calendar.months[simulationMonth].daysYear.first; uint endDay = firstDay + daysPerMonth; - DONNEES_MENSUELLES problem = H2O_J_Instanciation(); + DONNEES_MENSUELLES& problem = *H2O_J_Instanciation(); H2O_J_AjouterBruitAuCout(problem); problem.NombreDeJoursDuMois = (int)daysPerMonth; problem.TurbineDuMois = data.MOG[realmonth];