ASPECT
chunk.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 
22 #ifndef _aspect_geometry_model_chunk_h
23 #define _aspect_geometry_model_chunk_h
24 
27 #include <aspect/compat.h>
28 
29 #include <deal.II/grid/manifold.h>
30 #include <deal.II/base/function_lib.h>
31 #include <deal.II/grid/grid_out.h>
32 
33 namespace aspect
34 {
35  namespace GeometryModel
36  {
37  namespace internal
38  {
51  template <int dim>
52  class ChunkGeometry : public ChartManifold<dim,dim>
53  {
54  public:
59  const double min_longitude,
60  const double min_radius,
61  const double max_depth);
62 
66  ChunkGeometry(const ChunkGeometry &other) = default;
67 
73  Point<dim>
74  pull_back(const Point<dim> &space_point) const override;
75 
82  Point<dim>
83  push_forward(const Point<dim> &chart_point) const override;
84 
90  DerivativeForm<1, dim, dim>
91  push_forward_gradient(const Point<dim> &chart_point) const override;
92 
97  Point<dim>
98  pull_back_sphere(const Point<dim> &space_point) const;
99 
105  Point<dim>
106  push_forward_sphere(const Point<dim> &chart_point) const;
107 
111  virtual Tensor<1, dim>
113  const typename Triangulation<dim>::face_iterator &face,
114  const Point<dim> &p) const override;
115 
122  double
123  get_radius(const Point<dim> &space_point) const;
124 
128  std::unique_ptr<Manifold<dim,dim>>
129  clone() const override;
130 
131  private:
136 
140  double point1_lon;
141 
145  double inner_radius;
146 
151  double max_depth;
152 
158  virtual
159  Point<dim>
160  pull_back_topo(const Point<dim> &space_point) const;
161 
167  virtual
168  Point<dim>
169  push_forward_topo(const Point<dim> &chart_point) const;
170  };
171  }
172 
190  template <int dim>
191  class Chunk : public Interface<dim>, public SimulatorAccess<dim>
192  {
193  public:
194 
203  void initialize () override;
204 
208  void create_coarse_mesh (parallel::distributed::Triangulation<dim> &coarse_grid) const override;
209 
210 
221  std::set<types::boundary_id>
222  get_used_boundary_indicators () const override;
223 
236  std::map<std::string,types::boundary_id>
237  get_symbolic_boundary_names_map () const override;
238 
239 
250  double length_scale () const override;
251 
265  double depth(const Point<dim> &position) const override;
266 
271  double height_above_reference_surface(const Point<dim> &position) const override;
272 
276  Point<dim> representative_point(const double depth) const override;
277 
282  virtual
283  double west_longitude() const;
284 
289  virtual
290  double east_longitude() const;
291 
295  virtual
296  double longitude_range() const;
297 
302  virtual
303  double south_latitude() const;
304 
309  virtual
310  double north_latitude() const;
311 
315  virtual
316  double latitude_range() const;
317 
322  double maximal_depth() const override;
323 
327  virtual
328  double inner_radius() const;
329 
333  virtual
334  double outer_radius() const;
335 
336 
342  bool
343  has_curved_elements() const override;
344 
350  bool
351  point_is_in_domain(const Point<dim> &point) const override;
352 
357  aspect::Utilities::Coordinates::CoordinateSystem natural_coordinate_system() const override;
358 
364  std::array<double,dim> cartesian_to_natural_coordinates(const Point<dim> &position) const override;
365 
371  Point<dim> natural_to_cartesian_coordinates(const std::array<double,dim> &position) const override;
372 
376  static
377  void
378  declare_parameters (ParameterHandler &prm);
379 
383  void
384  parse_parameters (ParameterHandler &prm) override;
385 
386  private:
391  Point<dim> point1;
392 
397  Point<dim> point2;
398 
402  std::array<unsigned int, dim> repetitions;
403 
415  std::unique_ptr<const internal::ChunkGeometry<dim>> manifold;
416 
420  static constexpr types::manifold_id my_manifold_id = 15;
421  };
422  }
423 }
424 
425 
426 #endif
DerivativeForm< 1, dim, dim > push_forward_gradient(const Point< dim > &chart_point) const override
std::array< unsigned int, dim > repetitions
Definition: chunk.h:402
const InitialTopographyModel::Interface< dim > * topo
Definition: chunk.h:135
virtual Point< dim > pull_back_topo(const Point< dim > &space_point) const
std::unique_ptr< const internal::ChunkGeometry< dim > > manifold
Definition: chunk.h:415
ChunkGeometry(const InitialTopographyModel::Interface< dim > &topography, const double min_longitude, const double min_radius, const double max_depth)
void declare_parameters(ParameterHandler &prm)
Point< dim > pull_back_sphere(const Point< dim > &space_point) const
double get_radius(const Point< dim > &space_point) const
Point< dim > pull_back(const Point< dim > &space_point) const override
virtual Point< dim > push_forward_topo(const Point< dim > &chart_point) const
Definition: compat.h:59
virtual Tensor< 1, dim > normal_vector(const typename Triangulation< dim >::face_iterator &face, const Point< dim > &p) const override
Point< dim > push_forward_sphere(const Point< dim > &chart_point) const
std::unique_ptr< Manifold< dim, dim > > clone() const override
Point< dim > push_forward(const Point< dim > &chart_point) const override