#include "kernel.hpp" Kernel::Kernel(string filename){ fstream file; file.open(filename.c_str(),fstream::in|fstream::binary); InputData::load(file,true); initSolutions(); Solution& S0=*solution[0]; //Init pressure for(size_t x=0;xPinit[x][z]; } } //Init hydraulic head for(size_t x=0;xhsat[x]+Psat/(Physics::rho*Physics::g); } //Init overland level for(size_t x=0;xhsat[x]; S0.l[x]=t; S0.hsat[x]=t; } //Init Pl for(size_t x=0;xinit(geometry); solution[0]=S0; for(size_t i=1;i<=Time::nT;++i) solution[i]=nullptr; for(size_t i=0;iinit(geometry); pool_solutions.push(S); } } bool Kernel::next(){ //cout<<"[Kernel::next]"<1) m=m/2; spaceSolution(); if(scheme_error>0) return false; ++step; //cout<<"[next] done"<=tolerence_Piccard and counttolerence_Piccard/100 or error=tolerence_Piccard){ return nullptr; //Faire attention à la pile -> rempiler des solutions } return Snew; } void Kernel::compute_l(Solution& S,double& error) { //Update S.l using S.hsat bool e=0; for(size_t ix=0;ix>a;} if(q>max_Richards_time_subdivisions) return false; return true; } void Kernel::compute_mass(Solution& S){ } bool Kernel::horizontalProblem(Solution& S,double& error){ //Compute hydr from P, l, Pl, sources, time //return error otherwise return true; } bool Kernel::overlandProblem(const Solution& S_in,Solution& S_out,double& error){ //Compute hov //return error otherwise return true; } void Kernel::saturationInterface(const Solution& S_in,Solution& S_out){ /* Solution& S_in=*solution[sol_in]; Solution& S_out=*solution[sol_out]; for(size_t ix=0;ixPsat;++iz); if(iz>0 and Px_in[iz]<=Psat){ S_out.hsat[ix]=(Psat-Px_in[iz-1])*geometry.dZ[ix]/(Px_in[iz]-Px_in[iz-1])+geometry.Z[ix][iz-1]; } else{ S_out.hsat[ix]=(iz==0)?geometry.hbot[ix]:geometry.hsoil[ix]; } }*/ } double Kernel::bottomFluxRichards(size_t ix,const Solution& S){ return 0; } void Kernel::compute_div_w(size_t ix,const Solution& S){ double* div_w_ix=div_w[ix]; for(size_t iz=0;iz