ASPECT
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 
28 #include <deal.II/grid/manifold.h>
29 #include <deal.II/base/function_lib.h>
30 #include <deal.II/grid/grid_out.h>
31 
32 namespace aspect
33 {
34  namespace GeometryModel
35  {
36  namespace internal
37  {
50  template <int dim>
51  class ChunkGeometry : public ChartManifold<dim,dim>
52  {
53  public:
57  ChunkGeometry(const std::shared_ptr<const InitialTopographyModel::Interface<dim>> &topography,
58  const double min_longitude,
59  const double min_radius,
60  const double max_depth);
61 
65  ChunkGeometry(const ChunkGeometry &other) = default;
66 
72  Point<dim>
73  pull_back(const Point<dim> &space_point) const override;
74 
81  Point<dim>
82  push_forward(const Point<dim> &chart_point) const override;
83 
89  DerivativeForm<1, dim, dim>
90  push_forward_gradient(const Point<dim> &chart_point) const override;
91 
96  Point<dim>
97  pull_back_sphere(const Point<dim> &space_point) const;
98 
104  Point<dim>
105  push_forward_sphere(const Point<dim> &chart_point) const;
106 
110  virtual Tensor<1, dim>
112  const typename Triangulation<dim>::face_iterator &face,
113  const Point<dim> &p) const override;
114 
118  std::unique_ptr<Manifold<dim,dim>>
119  clone() const override;
120 
124  double topography_for_point(const Point<dim> &x_y_z) const;
125 
126  private:
130  const std::shared_ptr<const InitialTopographyModel::Interface<dim>> topo;
131 
135  double point1_lon;
136 
140  double inner_radius;
141 
146  double max_depth;
147 
153  virtual
154  Point<dim>
155  pull_back_topo(const Point<dim> &space_point) const;
156 
162  virtual
163  Point<dim>
164  push_forward_topo(const Point<dim> &chart_point) const;
165  };
166  }
167 
185  template <int dim>
186  class Chunk : public Interface<dim>, public SimulatorAccess<dim>
187  {
188  public:
189 
198  void initialize () override;
199 
203  void create_coarse_mesh (parallel::distributed::Triangulation<dim> &coarse_grid) const override;
204 
205 
216  std::set<types::boundary_id>
217  get_used_boundary_indicators () const override;
218 
231  std::map<std::string,types::boundary_id>
232  get_symbolic_boundary_names_map () const override;
233 
234 
245  double length_scale () const override;
246 
260  double depth(const Point<dim> &position) const override;
261 
266  double height_above_reference_surface(const Point<dim> &position) const override;
267 
271  Point<dim> representative_point(const double depth) const override;
272 
277  virtual
278  double west_longitude() const;
279 
284  virtual
285  double east_longitude() const;
286 
290  virtual
291  double longitude_range() const;
292 
297  virtual
298  double south_latitude() const;
299 
304  virtual
305  double north_latitude() const;
306 
310  virtual
311  double latitude_range() const;
312 
317  double maximal_depth() const override;
318 
322  virtual
323  double inner_radius() const;
324 
328  virtual
329  double outer_radius() const;
330 
331 
337  bool
338  has_curved_elements() const override;
339 
345  bool
346  point_is_in_domain(const Point<dim> &point) const override;
347 
352  aspect::Utilities::Coordinates::CoordinateSystem natural_coordinate_system() const override;
353 
359  std::array<double,dim> cartesian_to_natural_coordinates(const Point<dim> &position) const override;
360 
366  Point<dim> natural_to_cartesian_coordinates(const std::array<double,dim> &position) const override;
367 
371  static
372  void
373  declare_parameters (ParameterHandler &prm);
374 
378  void
379  parse_parameters (ParameterHandler &prm) override;
380 
381  private:
386  Point<dim> point1;
387 
392  Point<dim> point2;
393 
397  std::array<unsigned int, dim> repetitions;
398 
410  std::unique_ptr<const internal::ChunkGeometry<dim>> manifold;
411 
415  static constexpr types::manifold_id my_manifold_id = 15;
416  };
417  }
418 }
419 
420 
421 #endif
DerivativeForm< 1, dim, dim > push_forward_gradient(const Point< dim > &chart_point) const override
std::array< unsigned int, dim > repetitions
Definition: chunk.h:397
virtual Point< dim > pull_back_topo(const Point< dim > &space_point) const
const std::shared_ptr< const InitialTopographyModel::Interface< dim > > topo
Definition: chunk.h:130
std::unique_ptr< const internal::ChunkGeometry< dim > > manifold
Definition: chunk.h:410
double topography_for_point(const Point< dim > &x_y_z) const
void declare_parameters(ParameterHandler &prm)
ChunkGeometry(const std::shared_ptr< const InitialTopographyModel::Interface< dim >> &topography, const double min_longitude, const double min_radius, const double max_depth)
Point< dim > pull_back_sphere(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
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