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  namespace MeshDeformation
33  {
42  template <int dim>
43  class FastScape : public Interface<dim>, public SimulatorAccess<dim>
44  {
45  public:
49  virtual void initialize () override;
50 
54  ~FastScape() override;
55 
62  virtual
63  void
64  compute_velocity_constraints_on_boundary(const DoFHandler<dim> &mesh_deformation_dof_handler,
65  AffineConstraints<double> &mesh_velocity_constraints,
66  const std::set<types::boundary_id> &boundary_id) const override;
67 
71  bool needs_surface_stabilization () const override;
72 
76  static
77  void declare_parameters (ParameterHandler &prm);
78 
82  void parse_parameters (ParameterHandler &prm) override;
83 
84  private:
95  void set_ghost_nodes(std::vector<double> &elevation,
96  std::vector<double> &velocity_x,
97  std::vector<double> &velocity_y,
98  std::vector<double> &velocity_z,
99  const double &fastscape_timestep_in_years,
100  const bool init) const;
101 
105  bool is_ghost_node(const unsigned int &index,
106  const bool &exclude_boundaries) const;
107 
111  void fill_fastscape_arrays(std::vector<double> &elevation,
112  std::vector<double> &bedrock_transport_coefficient_array,
113  std::vector<double> &bedrock_river_incision_rate_array,
114  std::vector<double> &velocity_x,
115  std::vector<double> &velocity_y,
116  std::vector<double> &velocity_z,
117  std::vector<std::vector<double>> &temporary_variables) const;
118 
122  std::vector<std::vector<double>> get_aspect_values() const;
123 
127  void initialize_fastscape(std::vector<double> &elevation,
128  std::vector<double> &basement,
129  std::vector<double> &bedrock_transport_coefficient_array,
130  std::vector<double> &bedrock_river_incision_rate_array,
131  std::vector<double> &silt_fraction) const;
132 
136  void execute_fastscape(std::vector<double> &elevation,
137  std::vector<double> &extra_vtk_field,
138  std::vector<double> &velocity_x,
139  std::vector<double> &velocity_y,
140  std::vector<double> &velocity_z,
141  const double &fastscape_timestep_in_years,
142  const unsigned int &fastscape_iterations) const;
143 
148  void apply_orographic_controls(const std::vector<double> &elevation,
149  std::vector<double> &bedrock_river_incision_rate_array,
150  std::vector<double> &bedrock_transport_coefficient_array) const;
151 
155  Table<dim,double> fill_data_table(std::vector<double> &values,
156  TableIndices<dim> &size_idx,
157  const unsigned int &fastscape_nx,
158  const unsigned int &fastscape_ny) const;
159 
163  void read_restart_files(std::vector<double> &elevation,
164  std::vector<double> &basement,
165  std::vector<double> &silt_fraction) const;
166 
170  void save_restart_files(const std::vector<double> &elevation,
171  std::vector<double> &basement,
172  std::vector<double> &silt_fraction) const;
173 
179  unsigned int fastscape_steps_per_aspect_step;
180 
185  double maximum_fastscape_timestep;
186 
195  mutable bool restart;
196 
200  double fastscape_dx;
201 
205  double fastscape_dy;
206 
210  double fastscape_x_extent;
211 
215  double fastscape_y_extent;
216 
220  double fastscape_y_extent_2d;
221 
225  unsigned int fastscape_nx;
226 
230  unsigned int fastscape_ny;
231 
235  double vexp;
236 
240  unsigned int additional_refinement_levels;
241 
247  unsigned int maximum_surface_refinement_level;
248 
260  unsigned int surface_refinement_difference;
261 
267  bool average_out_of_plane_surface_topography;
268 
272  int fastscape_seed;
273 
277  std::array<std::pair<double,double>,dim> grid_extent;
278 
282  std::array<unsigned int, dim> table_intervals;
283 
287  bool use_ghost_nodes;
288 
294  double noise_elevation;
295 
300  std::vector<double> sediment_rain_rates;
301 
307  std::vector<double> sediment_rain_times;
308 
314  bool fastscape_advection_uplift;
315 
323  double node_tolerance;
324 
330  double output_interval;
331 
336  mutable double last_output_time;
337 
349  unsigned int bottom;
350 
357  unsigned int top;
358 
365  unsigned int right;
366 
373  unsigned int left;
374 
378  bool topbottom_ghost_nodes_periodic;
379  bool leftright_ghost_nodes_periodic;
380 
384  unsigned int fastscape_boundary_conditions;
385 
389  double bottom_flux;
390 
394  double top_flux;
395 
399  double right_flux;
400 
404  double left_flux;
417  double drainage_area_exponent_m;
418 
422  double slope_exponent_n;
423 
428  double slope_exponent_p;
429 
434  double bedrock_deposition_g;
435 
441  double sediment_deposition_g;
442 
447  double bedrock_river_incision_rate;
448 
454  double sediment_river_incision_rate;
455 
459  double bedrock_transport_coefficient;
460 
466  double sediment_transport_coefficient;
483  double sea_level;
484 
489  bool use_fixed_erosional_base;
490 
494  double h_erosional_base;
495 
499  double sand_surface_porosity;
500 
504  double silt_surface_porosity;
505 
509  double sand_efold_depth;
510 
514  double silt_efold_depth;
515 
519  double sand_silt_ratio;
520 
524  double sand_silt_averaging_depth;
525 
529  double sand_transport_coefficient;
530 
534  double silt_transport_coefficient;
535 
539  bool use_marine_component;
553  int flat_elevation;
554 
560  int wind_barrier_elevation;
561 
565  unsigned int wind_direction;
566 
571  double flat_erosional_factor;
572 
577  double wind_barrier_erosional_factor;
578 
582  bool stack_controls;
583 
587  bool use_orographic_controls;
591  };
592  }
593 }
594 
595 #endif
596 #endif
void declare_parameters(ParameterHandler &prm)
Definition: compat.h:59