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 
83  double boundary_composition (const types::boundary_id boundary_indicator,
84  const Point<dim> &position,
85  const unsigned int compositional_field) const override;
86 
90  bool needs_surface_stabilization () const override;
91 
95  static
97 
101  void parse_parameters (ParameterHandler &prm) override;
102 
107  enum class FastscapeOutputVariable
108  {
109  //
110  kf,
111  kd,
112  uplift_rate
113  };
114  FastscapeOutputVariable additional_output_variable;
115 
120  template <class Archive>
121  void serialize (Archive &ar, const unsigned int version);
122 
126  void save (std::map<std::string, std::string> &status_strings) const override;
127 
131  void load (const std::map<std::string, std::string> &status_strings) override;
132 
133  private:
144  void set_ghost_nodes(std::vector<double> &elevation,
145  std::vector<double> &velocity_x,
146  std::vector<double> &velocity_y,
147  std::vector<double> &velocity_z,
148  std::vector<double> &bedrock_transport_coefficient_array,
149  const double &fastscape_timestep_in_years,
150  const bool init) const;
151 
155  bool is_ghost_node(const unsigned int &index,
156  const bool &exclude_boundaries) const;
157 
161  void fill_fastscape_arrays(std::vector<double> &elevation,
162  std::vector<double> &bedrock_transport_coefficient_array,
163  std::vector<double> &bedrock_river_incision_rate_array,
164  std::vector<double> &velocity_x,
165  std::vector<double> &velocity_y,
166  std::vector<double> &velocity_z,
167  std::vector<std::vector<double>> &temporary_variables) const;
168 
172  std::vector<std::vector<double>> get_aspect_values() const;
173 
177  void initialize_fastscape(std::vector<double> &elevation,
178  std::vector<double> &basement,
179  std::vector<double> &silt_fraction,
180  bool restart) const;
181 
185  void execute_fastscape(std::vector<double> &elevation,
186  std::vector<double> &extra_vtk_field,
187  std::vector<double> &velocity_x,
188  std::vector<double> &velocity_y,
189  std::vector<double> &velocity_z,
190  std::vector<double> &bedrock_transport_coefficient_array,
191  const double &fastscape_timestep_in_years,
192  const unsigned int &fastscape_iterations) const;
193 
198  void apply_orographic_controls(const std::vector<double> &elevation,
199  std::vector<double> &bedrock_river_incision_rate_array,
200  std::vector<double> &bedrock_transport_coefficient_array) const;
201 
205  Table<dim,double> fill_data_table(const std::vector<double> &values,
206  const TableIndices<dim> &size_idx,
207  const unsigned int &fastscape_nx,
208  const unsigned int &fastscape_ny) const;
209 
217  unsigned int fastscape_steps_per_aspect_step;
218 
224  double maximum_fastscape_timestep;
225 
229  double fastscape_dx;
230 
234  double fastscape_dy;
235 
239  double fastscape_x_extent;
240 
244  double fastscape_y_extent;
245 
250  double fastscape_y_extent_2d;
251 
255  unsigned int fastscape_nx;
256 
260  unsigned int fastscape_ny;
261 
266  double vexp;
267 
272  unsigned int additional_refinement_levels;
273 
280  unsigned int maximum_surface_refinement_level;
281 
294  unsigned int surface_refinement_difference;
295 
302  bool average_out_of_plane_surface_topography;
303 
308  int fastscape_seed;
309 
313  std::array<std::pair<double,double>,dim> grid_extent;
314 
318  std::array<unsigned int, dim> table_intervals;
319 
324  bool use_ghost_nodes;
325 
332  double noise_elevation;
333 
339  std::vector<double> sediment_rain_rates;
340 
347  std::vector<double> sediment_rain_times;
348 
355  bool fastscape_advection_uplift;
356 
365  double node_tolerance;
366 
373  double output_interval;
374 
379  mutable double last_output_time;
380 
393  unsigned int bottom;
394 
402  unsigned int top;
403 
411  unsigned int right;
412 
420  unsigned int left;
421 
428  bool topbottom_ghost_nodes_periodic;
429 
436  bool leftright_ghost_nodes_periodic;
437 
441  unsigned int fastscape_boundary_conditions;
442 
447  double bottom_flux;
448 
453  double top_flux;
454 
459  double right_flux;
460 
465  double left_flux;
479  double drainage_area_exponent_m;
480 
485  double slope_exponent_n;
486 
492  double slope_exponent_p;
493 
499  double bedrock_deposition_g;
500 
507  double sediment_deposition_g;
508 
517  Functions::ParsedFunction<2> kf_distribution_function;
518 
523  bool use_kf_distribution_function;
524 
533  double constant_bedrock_river_incision_rate;
534 
544  double sediment_river_incision_rate;
545 
554  Functions::ParsedFunction<2> kd_distribution_function;
555 
560  bool use_kd_distribution_function;
561 
570  double constant_bedrock_transport_coefficient;
571 
581  double sediment_transport_coefficient;
604  double sea_level_constant_value;
605 
609  Functions::ParsedFunction<1> sea_level_function;
610 
615  bool use_sea_level_function;
616 
622  bool use_fixed_erosional_base;
623 
628  double h_erosional_base;
629 
634  double sand_surface_porosity;
635 
640  double silt_surface_porosity;
641 
646  double sand_efold_depth;
647 
652  double silt_efold_depth;
653 
658  double incoming_silt_fraction;
659 
664  double sand_silt_averaging_depth;
665 
670  double sand_transport_coefficient;
671 
676  double silt_transport_coefficient;
677 
682  bool use_marine_component;
697  int flat_elevation;
698 
705  int wind_barrier_elevation;
706 
711  unsigned int wind_direction;
712 
718  double flat_erosional_factor;
719 
725  double wind_barrier_erosional_factor;
726 
731  bool stack_controls;
732 
738  bool use_orographic_controls;
742  };
743  }
744 }
745 
746 #endif
747 #endif
void serialize(Archive &ar, ::std_cxx26::inplace_vector< T, N > &t, const unsigned int file_version)
void declare_parameters(ParameterHandler &prm)
void save(Archive &ar, const ::std_cxx26::inplace_vector< T, N > &vec, const unsigned int)
void load(Archive &ar, ::std_cxx26::inplace_vector< T, N > &vec, const unsigned int)
unsigned int boundary_id