geometry.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef GEOMETRY_HPP
  2. #define GEOMETRY_HPP
  3. #include <iostream>
  4. #include <fstream>
  5. #include <limits>
  6. #include "math/spline.hpp"
  7. using namespace std;
  8. using Func = double (*)(double);
  9. extern double inf;
  10. //! The Geometry class contains all geometric parameters of the domain.
  11. class Geometry{
  12. public:
  13. //! Horizontal length of the domain
  14. double lX;
  15. //! Number of horizontal steps
  16. size_t nX;
  17. //! Horizontal step
  18. double dX;
  19. //! Level of the soil depending on X, e.g, hsoil[k]=level of the soil at X=k*dX.
  20. //! Vector of size nX.
  21. double* hsoil;
  22. //! Derivative of the soil depending on X, vector of size nX.
  23. double* dhsoil;
  24. //! Level of the bottom depending on X, e.g, hbot[k]=level of the bottom at X=k*dX.
  25. //! Vector of size nX.
  26. double* hbot;
  27. //! Derivative of the bottom depending on X, vector of size nX.
  28. double* dhbot;
  29. //! Number of vertical step at a given X, vector of size nX.
  30. size_t* nZ;
  31. //! Vertical step at a given X, vector of size nX.
  32. double* dZ;
  33. //! Vertical considered positions at a given X, vector of vectors of size nX. For each k, Z[k] is a vector of size nZ[k]
  34. double** Z;
  35. //!
  36. Geometry();
  37. ~Geometry();
  38. void initZ(double dZ_avg,bool init=true);
  39. void save(fstream& file);
  40. void load(fstream& file,bool init);
  41. };
  42. #endif