piccard.hpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef PICCARD_HPP
  2. #define PICCARD_HPP
  3. #include <cstring>
  4. #include "solution.hpp"
  5. #include "horizontal_problem.hpp"
  6. #include "all_vertical_richards.hpp"
  7. #include "overland.hpp"
  8. namespace Kernel{
  9. //! A class implementing Piccard algorithm
  10. class Piccard{
  11. private:
  12. static constexpr double tolerence_Piccard=1e-6;
  13. static constexpr double oscilation_Piccard=1e-4;
  14. static constexpr size_t max_iterations_Piccard=50;
  15. //! Geometry of the simulation
  16. const Geometry* geometry;
  17. double** pumps;
  18. //! A pointer to an HorizontalProblem object
  19. HorizontalProblem horizontal_problem;
  20. //! A pointer to an Overland object
  21. Overland overland;
  22. //! A pointer to an AllVerticalRichards object
  23. AllVerticalRichards all_vertical_richards;
  24. double *l;
  25. double *Pl;
  26. //! Compute l from h and hsat
  27. void compute_l(double* h,double* hsat,double& error);
  28. //! Compute Pl from l and P
  29. void compute_Pl(double** P);
  30. double n1_previous_hydr;
  31. double* error_x;
  32. public:
  33. double dt;
  34. Solution* previous_solution;
  35. Solution* new_solution;
  36. bool has_converged;
  37. //! Construct an empty Piccard object
  38. Piccard();
  39. //! Init from a Geometry
  40. void init(const Geometry* geometry,double** pumps);
  41. //! Compute a new Solution form a previous once.
  42. //! The delta time depends of the number of subdivisions required by Solver::space_solution.
  43. void run();
  44. };
  45. }
  46. #endif