#include "solver.hpp" namespace Kernel{ Solver::Solver(string filename){ fstream file; file.open(filename.c_str(),fstream::in|fstream::binary); input_data.load(file,true); input_data.geometry.compute_basins(); file.close(); //HACK for pump for(auto it=input_data.source.pumps.begin();it!=input_data.source.pumps.end();++it){ Pump& P=*(*it); double lX=input_data.geometry.lX; P.left_init*=lX; P.right_init*=lX; P.delta_left_init*=lX; P.delta_right_init*=lX; P.left_final*=lX; P.right_final*=lX; P.delta_left_final*=lX; P.delta_right_final*=lX; } pumps=new double*[input_data.geometry.nX]; for(size_t ix=0;ixPinit[x][z]; } } //Init hydraulic head for(size_t x=0;xhsat[x]+Psat/(Physics::rho*Physics::g); } //[Obsolete] ////Init overland level //for(size_t x=0;xhov[x]; } //Init l for(size_t x=0;xhsat[x]; s.l[x]=t; s.hsat[x]=t; } //Init Pl for(size_t x=0;x1) m1=m1/2; Solution* s=space_solution(); if(s==nullptr) return false; solutions[number_computed_solutions++]=s; //cout<<"[next] done"<1) cout<<" [Solver::spaceSolution] n1 = "<value(x,z,t/Time::T); pumps[ix][iz]+=p; } } } } }