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 
30 namespace aspect
31 {
32  using namespace dealii;
33 
34  namespace MeshDeformation
35  {
44  template <int dim>
45  class FastScape : public Interface<dim>, public SimulatorAccess<dim>
46  {
47  public:
51  virtual void initialize () override;
52 
56  ~FastScape() override;
57 
64  virtual
65  void
66  compute_velocity_constraints_on_boundary(const DoFHandler<dim> &mesh_deformation_dof_handler,
67  AffineConstraints<double> &mesh_velocity_constraints,
68  const std::set<types::boundary_id> &boundary_id) const override;
69 
73  bool needs_surface_stabilization () const override;
74 
78  static
79  void declare_parameters (ParameterHandler &prm);
80 
84  void parse_parameters (ParameterHandler &prm) override;
85 
86  private:
97  void set_ghost_nodes(std::vector<double> &elevation,
98  std::vector<double> &velocity_x,
99  std::vector<double> &velocity_y,
100  std::vector<double> &velocity_z,
101  const double &fastscape_timestep_in_years,
102  const bool init) const;
103 
107  bool is_ghost_node(const unsigned int &index,
108  const bool &exclude_boundaries) const;
109 
113  void fill_fastscape_arrays(std::vector<double> &elevation,
114  std::vector<double> &bedrock_transport_coefficient_array,
115  std::vector<double> &bedrock_river_incision_rate_array,
116  std::vector<double> &velocity_x,
117  std::vector<double> &velocity_y,
118  std::vector<double> &velocity_z,
119  std::vector<std::vector<double>> &temporary_variables) const;
120 
124  std::vector<std::vector<double>> get_aspect_values() const;
125 
129  void initialize_fastscape(std::vector<double> &elevation,
130  std::vector<double> &basement,
131  std::vector<double> &bedrock_transport_coefficient_array,
132  std::vector<double> &bedrock_river_incision_rate_array,
133  std::vector<double> &silt_fraction) const;
134 
138  void execute_fastscape(std::vector<double> &elevation,
139  std::vector<double> &extra_vtk_field,
140  std::vector<double> &velocity_x,
141  std::vector<double> &velocity_y,
142  std::vector<double> &velocity_z,
143  const double &fastscape_timestep_in_years,
144  const unsigned int &fastscape_iterations) const;
145 
150  void apply_orographic_controls(const std::vector<double> &elevation,
151  std::vector<double> &bedrock_river_incision_rate_array,
152  std::vector<double> &bedrock_transport_coefficient_array) const;
153 
157  Table<dim,double> fill_data_table(std::vector<double> &values,
158  TableIndices<dim> &size_idx,
159  const unsigned int &fastscape_nx,
160  const unsigned int &fastscape_ny) const;
161 
165  void read_restart_files(std::vector<double> &elevation,
166  std::vector<double> &basement,
167  std::vector<double> &silt_fraction) const;
168 
172  void save_restart_files(const std::vector<double> &elevation,
173  std::vector<double> &basement,
174  std::vector<double> &silt_fraction) const;
175 
181  unsigned int fastscape_steps_per_aspect_step;
182 
187  double maximum_fastscape_timestep;
188 
197  mutable bool restart;
198 
202  double fastscape_dx;
203 
207  double fastscape_dy;
208 
212  double fastscape_x_extent;
213 
217  double fastscape_y_extent;
218 
222  double fastscape_y_extent_2d;
223 
227  unsigned int fastscape_nx;
228 
232  unsigned int fastscape_ny;
233 
237  double vexp;
238 
242  unsigned int additional_refinement_levels;
243 
249  unsigned int maximum_surface_refinement_level;
250 
262  unsigned int surface_refinement_difference;
263 
269  bool average_out_of_plane_surface_topography;
270 
274  int fastscape_seed;
275 
279  std::array<std::pair<double,double>,dim> grid_extent;
280 
284  std::array<unsigned int, dim> table_intervals;
285 
289  bool use_ghost_nodes;
290 
296  double noise_elevation;
297 
302  std::vector<double> sediment_rain_rates;
303 
309  std::vector<double> sediment_rain_times;
310 
316  bool fastscape_advection_uplift;
317 
325  double node_tolerance;
326 
332  double output_interval;
333 
338  mutable double last_output_time;
339 
351  unsigned int bottom;
352 
359  unsigned int top;
360 
367  unsigned int right;
368 
375  unsigned int left;
376 
380  bool topbottom_ghost_nodes_periodic;
381  bool leftright_ghost_nodes_periodic;
382 
386  unsigned int fastscape_boundary_conditions;
387 
391  double bottom_flux;
392 
396  double top_flux;
397 
401  double right_flux;
402 
406  double left_flux;
419  double drainage_area_exponent_m;
420 
424  double slope_exponent_n;
425 
430  double slope_exponent_p;
431 
436  double bedrock_deposition_g;
437 
443  double sediment_deposition_g;
444 
449  double bedrock_river_incision_rate;
450 
456  double sediment_river_incision_rate;
457 
461  double bedrock_transport_coefficient;
462 
468  double sediment_transport_coefficient;
485  double sea_level;
486 
491  bool use_fixed_erosional_base;
492 
496  double h_erosional_base;
497 
501  double sand_surface_porosity;
502 
506  double silt_surface_porosity;
507 
511  double sand_efold_depth;
512 
516  double silt_efold_depth;
517 
521  double sand_silt_ratio;
522 
526  double sand_silt_averaging_depth;
527 
531  double sand_transport_coefficient;
532 
536  double silt_transport_coefficient;
537 
541  bool use_marine_component;
555  int flat_elevation;
556 
562  int wind_barrier_elevation;
563 
567  unsigned int wind_direction;
568 
573  double flat_erosional_factor;
574 
579  double wind_barrier_erosional_factor;
580 
584  bool stack_controls;
585 
589  bool use_orographic_controls;
593  };
594  }
595 }
596 
597 #endif
598 #endif
void declare_parameters(ParameterHandler &prm)
Definition: compat.h:59
Definition: compat.h:42