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 
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  ~FastScape() override;
51 
55  virtual void initialize () override;
56 
60  void update() 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_ids) const override;
73 
77  bool needs_surface_stabilization () const override;
78 
82  static
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 
204  unsigned int fastscape_steps_per_aspect_step;
205 
211  double maximum_fastscape_timestep;
212 
216  double fastscape_dx;
217 
221  double fastscape_dy;
222 
226  double fastscape_x_extent;
227 
231  double fastscape_y_extent;
232 
237  double fastscape_y_extent_2d;
238 
242  unsigned int fastscape_nx;
243 
247  unsigned int fastscape_ny;
248 
253  double vexp;
254 
259  unsigned int additional_refinement_levels;
260 
267  unsigned int maximum_surface_refinement_level;
268 
281  unsigned int surface_refinement_difference;
282 
289  bool average_out_of_plane_surface_topography;
290 
295  int fastscape_seed;
296 
300  std::array<std::pair<double,double>,dim> grid_extent;
301 
305  std::array<unsigned int, dim> table_intervals;
306 
311  bool use_ghost_nodes;
312 
319  double noise_elevation;
320 
326  std::vector<double> sediment_rain_rates;
327 
334  std::vector<double> sediment_rain_times;
335 
342  bool fastscape_advection_uplift;
343 
352  double node_tolerance;
353 
360  double output_interval;
361 
366  mutable double last_output_time;
367 
380  unsigned int bottom;
381 
389  unsigned int top;
390 
398  unsigned int right;
399 
407  unsigned int left;
408 
415  bool topbottom_ghost_nodes_periodic;
416 
423  bool leftright_ghost_nodes_periodic;
424 
428  unsigned int fastscape_boundary_conditions;
429 
434  double bottom_flux;
435 
440  double top_flux;
441 
446  double right_flux;
447 
452  double left_flux;
466  double drainage_area_exponent_m;
467 
472  double slope_exponent_n;
473 
479  double slope_exponent_p;
480 
486  double bedrock_deposition_g;
487 
494  double sediment_deposition_g;
495 
504  Functions::ParsedFunction<2> kf_distribution_function;
505 
510  bool use_kf_distribution_function;
511 
520  double constant_bedrock_river_incision_rate;
521 
531  double sediment_river_incision_rate;
532 
541  Functions::ParsedFunction<2> kd_distribution_function;
542 
547  bool use_kd_distribution_function;
548 
557  double constant_bedrock_transport_coefficient;
558 
568  double sediment_transport_coefficient;
591  double sea_level_constant_value;
592 
596  Functions::ParsedFunction<1> sea_level_function;
597 
602  bool use_sea_level_function;
603 
609  bool use_fixed_erosional_base;
610 
615  double h_erosional_base;
616 
621  double sand_surface_porosity;
622 
627  double silt_surface_porosity;
628 
633  double sand_efold_depth;
634 
639  double silt_efold_depth;
640 
645  double incoming_silt_fraction;
646 
651  double sand_silt_averaging_depth;
652 
657  double sand_transport_coefficient;
658 
663  double silt_transport_coefficient;
664 
669  bool use_marine_component;
684  int flat_elevation;
685 
692  int wind_barrier_elevation;
693 
698  unsigned int wind_direction;
699 
705  double flat_erosional_factor;
706 
712  double wind_barrier_erosional_factor;
713 
718  bool stack_controls;
719 
725  bool use_orographic_controls;
729  };
730  }
731 }
732 
733 #endif
734 #endif
void declare_parameters(ParameterHandler &prm)
void load(Archive &ar, ::std_cxx26::inplace_vector< T, N > &vec, const unsigned int)
void save(Archive &ar, const ::std_cxx26::inplace_vector< T, N > &vec, const unsigned int)
void serialize(Archive &ar, ::std_cxx26::inplace_vector< T, N > &t, const unsigned int file_version)