ASPECT
fastscape.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2023 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 
30 namespace aspect
31 {
32  using namespace dealii;
33 
34  namespace MeshDeformation
35  {
43  template<int dim>
44  class FastScape : public Interface<dim>, public SimulatorAccess<dim>
45  {
46  public:
50  virtual void initialize () override;
51 
55  ~FastScape() override;
56 
63  virtual
64  void
65  compute_velocity_constraints_on_boundary(const DoFHandler<dim> &mesh_deformation_dof_handler,
66  AffineConstraints<double> &mesh_velocity_constraints,
67  const std::set<types::boundary_id> &boundary_id) const override;
68 
72  bool needs_surface_stabilization () const override;
73 
77  static
78  void declare_parameters (ParameterHandler &prm);
79 
83  void parse_parameters (ParameterHandler &prm) override;
84 
85  private:
96  void set_ghost_nodes(std::vector<double> &elevation,
97  std::vector<double> &velocity_x,
98  std::vector<double> &velocity_y,
99  std::vector<double> &velocity_z,
100  const double &fastscape_timestep_in_years,
101  const bool init) const;
102 
106  bool is_ghost_node(const unsigned int &index,
107  const bool &exclude_boundaries) const;
108 
112  void fill_fastscape_arrays(std::vector<double> &elevation,
113  std::vector<double> &bedrock_transport_coefficient_array,
114  std::vector<double> &bedrock_river_incision_rate_array,
115  std::vector<double> &velocity_x,
116  std::vector<double> &velocity_y,
117  std::vector<double> &velocity_z,
118  std::vector<std::vector<double>> &temporary_variables) const;
119 
123  std::vector<std::vector<double>> get_aspect_values() const;
124 
128  void initialize_fastscape(std::vector<double> &elevation,
129  std::vector<double> &basement,
130  std::vector<double> &bedrock_transport_coefficient_array,
131  std::vector<double> &bedrock_river_incision_rate_array,
132  std::vector<double> &silt_fraction) const;
133 
137  void execute_fastscape(std::vector<double> &elevation,
138  std::vector<double> &extra_vtk_field,
139  std::vector<double> &velocity_x,
140  std::vector<double> &velocity_y,
141  std::vector<double> &velocity_z,
142  const double &fastscape_timestep_in_years,
143  const unsigned int &fastscape_iterations) const;
144 
149  void apply_orographic_controls(const std::vector<double> &elevation,
150  std::vector<double> &bedrock_river_incision_rate_array,
151  std::vector<double> &bedrock_transport_coefficient_array) const;
152 
156  Table<dim,double> fill_data_table(std::vector<double> &values,
157  TableIndices<dim> &size_idx,
158  const unsigned int &fastscape_nx,
159  const unsigned int &fastscape_ny) const;
160 
164  void read_restart_files(std::vector<double> &elevation,
165  std::vector<double> &basement,
166  std::vector<double> &silt_fraction) const;
167 
171  void save_restart_files(const std::vector<double> &elevation,
172  std::vector<double> &basement,
173  std::vector<double> &silt_fraction) const;
174 
180  unsigned int fastscape_steps_per_aspect_step;
181 
186  double maximum_fastscape_timestep;
187 
196  mutable bool restart;
197 
201  double fastscape_dx;
202 
206  double fastscape_dy;
207 
211  double fastscape_x_extent;
212 
216  double fastscape_y_extent;
217 
221  double fastscape_y_extent_2d;
222 
226  unsigned int fastscape_nx;
227 
231  unsigned int fastscape_ny;
232 
236  double vexp;
237 
241  unsigned int additional_refinement_levels;
242 
248  unsigned int maximum_surface_refinement_level;
249 
261  unsigned int surface_refinement_difference;
262 
268  bool average_out_of_plane_surface_topography;
269 
273  int fastscape_seed;
274 
278  std::array<std::pair<double,double>,dim> grid_extent;
279 
283  std::array<unsigned int, dim> table_intervals;
284 
288  bool use_ghost_nodes;
289 
295  double noise_elevation;
296 
301  std::vector<double> sediment_rain_rates;
302 
308  std::vector<double> sediment_rain_times;
309 
315  bool fastscape_advection_uplift;
316 
324  double node_tolerance;
325 
331  double output_interval;
332 
337  mutable double last_output_time;
338 
350  unsigned int bottom;
351 
358  unsigned int top;
359 
366  unsigned int right;
367 
374  unsigned int left;
375 
379  bool topbottom_ghost_nodes_periodic;
380  bool leftright_ghost_nodes_periodic;
381 
385  unsigned int fastscape_boundary_conditions;
386 
390  double bottom_flux;
391 
395  double top_flux;
396 
400  double right_flux;
401 
405  double left_flux;
418  double drainage_area_exponent_m;
419 
423  double slope_exponent_n;
424 
429  double slope_exponent_p;
430 
435  double bedrock_deposition_g;
436 
442  double sediment_deposition_g;
443 
448  double bedrock_river_incision_rate;
449 
455  double sediment_river_incision_rate;
456 
460  double bedrock_transport_coefficient;
461 
467  double sediment_transport_coefficient;
484  double sea_level;
485 
490  bool use_fixed_erosional_base;
491 
495  double h_erosional_base;
496 
500  double sand_surface_porosity;
501 
505  double silt_surface_porosity;
506 
510  double sand_efold_depth;
511 
515  double silt_efold_depth;
516 
520  double sand_silt_ratio;
521 
525  double sand_silt_averaging_depth;
526 
530  double sand_transport_coefficient;
531 
535  double silt_transport_coefficient;
536 
540  bool use_marine_component;
554  int flat_elevation;
555 
561  int wind_barrier_elevation;
562 
566  unsigned int wind_direction;
567 
572  double flat_erosional_factor;
573 
578  double wind_barrier_erosional_factor;
579 
583  bool stack_controls;
584 
588  bool use_orographic_controls;
592  };
593  }
594 }
595 
596 #endif
597 #endif
void declare_parameters(ParameterHandler &prm)
Definition: compat.h:42