1234567891011121314151617181920212223242526 |
- #include "initial_state_spline.hpp"
- void
- InitialStateSpline::update(Spline* _Ssat){
- Ssat=_Ssat;
- if(hsat!=nullptr){
- delete[] hsat;
- for(size_t i=0;i<geometry_spline->nX;++i){
- delete[] Pinit[i];
- }
- delete[] Pinit;
- }
- size_t nX=geometry_spline->nX;
- hsat=new double[nX];
- Pinit=new double*[nX];
- for(size_t i=0;i<nX;++i){
- size_t nZ=geometry_spline->nZ[i];
- Pinit[i]=new double[nZ];
- }
- for(size_t i=0;i<geometry_spline->nX;++i){
- double x=double(i)/(geometry_spline->nX-1);
- hsat[i]=(*Ssat)(x)*geometry_spline->factor;
- }
- updatePressure();
- }
|