geometry.hpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef GEOMETRY_HPP
  2. #define GEOMETRY_HPP
  3. #include <iostream>
  4. #include <limits>
  5. #include "math/spline.hpp"
  6. using namespace std;
  7. using Func = double (*)(double);
  8. extern double inf;
  9. //! The Geometry class contains all geometric parameters of the domain.
  10. class Geometry{
  11. public:
  12. //!
  13. Geometry();
  14. //! Geometry constructor
  15. Geometry(double _lX,size_t _nX,size_t _nZ,Func _hsoil,Func _dhsoil,Func _hbot,Func _dhbot);
  16. void initDefault();
  17. //! Horizontal length of the domain
  18. double lX;
  19. //! Number of horizontal steps
  20. size_t nX;
  21. //! Horizontal step
  22. double dX;
  23. size_t nZ_max;
  24. double depth;
  25. //! Level of the soil depending on X, e.g, hsoil[k]=level of the soil at X=k*dX.
  26. //! Vector of size nX.
  27. double* hsoil;
  28. //! Derivative of the soil depending on X, vector of size nX.
  29. double* dhsoil;
  30. //! Level of the bottom depending on X, e.g, hbot[k]=level of the bottom at X=k*dX.
  31. //! Vector of size nX.
  32. double* hbot;
  33. //! Derivative of the bottom depending on X, vector of size nX.
  34. double* dhbot;
  35. //! Number of vertical step at a given X, vector of size nX.
  36. size_t* nZ;
  37. //! Vertical step at a given X, vector of size nX.
  38. double* dZ;
  39. //! 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]
  40. double** Z;
  41. void initZ(double dZ_avg);
  42. void update(double _lX,size_t _nX,double _depth,size_t _nZ_max);
  43. };
  44. #endif