initial_state.hpp 857 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef INITIAL_STATE_HPP
  2. #define INITIAL_STATE_HPP
  3. #include <list>
  4. #include <fstream>
  5. #include "physics.hpp"
  6. #include "geometry.hpp"
  7. #include "math/spline.hpp"
  8. using namespace std;
  9. class Tank{
  10. public:
  11. double saturation;
  12. double left,right,bottom,top;
  13. double delta_left,delta_right,delta_bottom,delta_top;
  14. Tank();
  15. void save(fstream& file);
  16. void load(fstream& file);
  17. };
  18. class InitialState{
  19. private:
  20. Geometry* geometry;
  21. public:
  22. //! Vector of size nX
  23. double* hsat;
  24. double* hov;
  25. //! Vector of vector of size nX. For each k, Pinit[k] is a vector of size geometry->nZ[k]
  26. double** Pinit;
  27. list<Tank*> tanks;
  28. InitialState();
  29. InitialState(Geometry* geometry);
  30. ~InitialState();
  31. Tank* addTank();
  32. void removeTank(Tank* tank);
  33. void updatePressure();
  34. void save(fstream& file);
  35. void load(fstream& file,bool init);
  36. };
  37. #endif