ASPECT
fastscape.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2024 by the authors of the ASPECT code.
3 
4  This file is part of ASPECT.
5 
6  ASPECT is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2, or (at your option)
9  any later version.
10 
11  ASPECT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with ASPECT; see the file LICENSE. If not see
18  <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef _aspect_mesh_deformation_fastscape_h
22 #define _aspect_mesh_deformation_fastscape_h
23 
24 #include <aspect/global.h>
25 
26 #ifdef ASPECT_WITH_FASTSCAPE
27 
29 #include <deal.II/base/parsed_function.h>
30 
31 namespace aspect
32 {
33  namespace MeshDeformation
34  {
43  template <int dim>
44  class FastScape : public Interface<dim>, public SimulatorAccess<dim>
45  {
46  public:
50  virtual void initialize () override;
51 
55  void update() override;
56 
60  ~FastScape() override;
61 
68  virtual
69  void
70  compute_velocity_constraints_on_boundary(const DoFHandler<dim> &mesh_deformation_dof_handler,
71  AffineConstraints<double> &mesh_velocity_constraints,
72  const std::set<types::boundary_id> &boundary_id) const override;
73 
77  bool needs_surface_stabilization () const override;
78 
82  static
83  void declare_parameters (ParameterHandler &prm);
84 
88  void parse_parameters (ParameterHandler &prm) override;
89 
94  enum class FastscapeOutputVariable
95  {
96  //
97  kf,
98  kd,
99  uplift_rate
100  };
101  FastscapeOutputVariable additional_output_variable;
102 
107  template <class Archive>
108  void serialize (Archive &ar, const unsigned int version);
109 
113  void save (std::map<std::string, std::string> &status_strings) const override;
114 
118  void load (const std::map<std::string, std::string> &status_strings) override;
119 
120  private:
131  void set_ghost_nodes(std::vector<double> &elevation,
132  std::vector<double> &velocity_x,
133  std::vector<double> &velocity_y,
134  std::vector<double> &velocity_z,
135  std::vector<double> &bedrock_transport_coefficient_array,
136  const double &fastscape_timestep_in_years,
137  const bool init) const;
138 
142  bool is_ghost_node(const unsigned int &index,
143  const bool &exclude_boundaries) const;
144 
148  void fill_fastscape_arrays(std::vector<double> &elevation,
149  std::vector<double> &bedrock_transport_coefficient_array,
150  std::vector<double> &bedrock_river_incision_rate_array,
151  std::vector<double> &velocity_x,
152  std::vector<double> &velocity_y,
153  std::vector<double> &velocity_z,
154  std::vector<std::vector<double>> &temporary_variables) const;
155 
159  std::vector<std::vector<double>> get_aspect_values() const;
160 
164  void initialize_fastscape(std::vector<double> &elevation,
165  std::vector<double> &basement,
166  std::vector<double> &silt_fraction,
167  bool restart) const;
168 
172  void execute_fastscape(std::vector<double> &elevation,
173  std::vector<double> &extra_vtk_field,
174  std::vector<double> &velocity_x,
175  std::vector<double> &velocity_y,
176  std::vector<double> &velocity_z,
177  std::vector<double> &bedrock_transport_coefficient_array,
178  const double &fastscape_timestep_in_years,
179  const unsigned int &fastscape_iterations) const;
180 
185  void apply_orographic_controls(const std::vector<double> &elevation,
186  std::vector<double> &bedrock_river_incision_rate_array,
187  std::vector<double> &bedrock_transport_coefficient_array) const;
188 
192  Table<dim,double> fill_data_table(const std::vector<double> &values,
193  const TableIndices<dim> &size_idx,
194  const unsigned int &fastscape_nx,
195  const unsigned int &fastscape_ny) const;
196 
202  unsigned int fastscape_steps_per_aspect_step;
203 
208  double maximum_fastscape_timestep;
209 
213  double fastscape_dx;
214 
218  double fastscape_dy;
219 
223  double fastscape_x_extent;
224 
228  double fastscape_y_extent;
229 
233  double fastscape_y_extent_2d;
234 
238  unsigned int fastscape_nx;
239 
243  unsigned int fastscape_ny;
244 
248  double vexp;
249 
253  unsigned int additional_refinement_levels;
254 
260  unsigned int maximum_surface_refinement_level;
261 
273  unsigned int surface_refinement_difference;
274 
280  bool average_out_of_plane_surface_topography;
281 
285  int fastscape_seed;
286 
290  std::array<std::pair<double,double>,dim> grid_extent;
291 
295  std::array<unsigned int, dim> table_intervals;
296 
300  bool use_ghost_nodes;
301 
307  double noise_elevation;
308 
313  std::vector<double> sediment_rain_rates;
314 
320  std::vector<double> sediment_rain_times;
321 
327  bool fastscape_advection_uplift;
328 
336  double node_tolerance;
337 
343  double output_interval;
344 
349  mutable double last_output_time;
350 
362  unsigned int bottom;
363 
370  unsigned int top;
371 
378  unsigned int right;
379 
386  unsigned int left;
387 
391  bool topbottom_ghost_nodes_periodic;
392  bool leftright_ghost_nodes_periodic;
393 
397  unsigned int fastscape_boundary_conditions;
398 
402  double bottom_flux;
403 
407  double top_flux;
408 
412  double right_flux;
413 
417  double left_flux;
430  double drainage_area_exponent_m;
431 
435  double slope_exponent_n;
436 
441  double slope_exponent_p;
442 
447  double bedrock_deposition_g;
448 
454  double sediment_deposition_g;
455 
464  Functions::ParsedFunction<2> kf_distribution_function;
465 
469  bool use_kf_distribution_function;
470 
478  double constant_bedrock_river_incision_rate;
479 
488  double sediment_river_incision_rate;
489 
498  Functions::ParsedFunction<2> kd_distribution_function;
499 
503  bool use_kd_distribution_function;
504 
512  double constant_bedrock_transport_coefficient;
513 
522  double sediment_transport_coefficient;
544  double sea_level_constant_value;
545 
549  Functions::ParsedFunction<1> sea_level_function;
550 
554  bool use_sea_level_function;
555 
560  bool use_fixed_erosional_base;
561 
565  double h_erosional_base;
566 
570  double sand_surface_porosity;
571 
575  double silt_surface_porosity;
576 
580  double sand_efold_depth;
581 
585  double silt_efold_depth;
586 
590  double sand_silt_ratio;
591 
595  double sand_silt_averaging_depth;
596 
600  double sand_transport_coefficient;
601 
605  double silt_transport_coefficient;
606 
610  bool use_marine_component;
624  int flat_elevation;
625 
631  int wind_barrier_elevation;
632 
636  unsigned int wind_direction;
637 
642  double flat_erosional_factor;
643 
648  double wind_barrier_erosional_factor;
649 
653  bool stack_controls;
654 
658  bool use_orographic_controls;
662  };
663  }
664 }
665 
666 #endif
667 #endif
void declare_parameters(ParameterHandler &prm)