ASPECT
ellipsoidal_chunk.h
Go to the documentation of this file.
1 // ------------------------------------------------------
2 //
3 // SPDX-License-Identifier: GPL-2.0-or-later
4 //
5 // SPDX-FileCopyrightText: Copyright (C) 2011-2025 by the ASPECT authors.
6 //
7 // This file is part of ASPECT.
8 //
9 // Detailed license information governing the source code and
10 // contributions can be found in the folder LICENSES and in
11 // LICENSE and CONTRIBUTING.md at the top level directory.
12 //
13 // ------------------------------------------------------
14 
15 
16 #ifndef _aspect_geometry_model_ellipsoidal_chunk_h
17 #define _aspect_geometry_model_ellipsoidal_chunk_h
18 
22 #include <deal.II/grid/manifold.h>
23 
24 
25 namespace aspect
26 {
27  namespace GeometryModel
28  {
29  namespace internal
30  {
34  template <int dim>
35  class EllipsoidalChunkGeometry : public ChartManifold<dim,3,3>
36  {
37  public:
42  const double para_semi_major_axis_a,
43  const double para_eccentricity,
44  const double para_semi_minor_axis_b,
45  const double para_bottom_depth,
46  const std::vector<Point<2>> &para_corners);
47 
51  EllipsoidalChunkGeometry(const EllipsoidalChunkGeometry &other) = default;
52 
59  Point<3>
60  pull_back(const Point<3> &space_point) const override;
61 
66  virtual
67  Point<2>
68  pull_back(const Point<2> &space_point) const;
69 
76  Point<3>
77  push_forward(const Point<3> &chart_point) const override;
78 
83  Point<3> pull_back_ellipsoid (const Point<3> &x, const double semi_major_axis_a, const double eccentricity) const;
84 
89  Point<3> push_forward_ellipsoid (const Point<3> &phi_theta_d, const double semi_major_axis_a, const double eccentricity) const;
90 
94  std::unique_ptr<Manifold<dim,3>>
95  clone() const override;
96 
100  const std::shared_ptr<const InitialTopographyModel::Interface<dim>> topography;
101 
102  private:
107  Point<3> push_forward_topography (const Point<3> &phi_theta_d_hat) const;
108 
113  Point<3> pull_back_topography (const Point<3> &phi_theta_d) const;
114 
115  const double semi_major_axis_a;
116  const double eccentricity;
117  const double semi_minor_axis_b;
118  const double bottom_depth;
119  const std::vector<Point<2>> corners;
120  };
121  }
122 
131  template <int dim>
132  class EllipsoidalChunk : public Interface<dim>, public SimulatorAccess<dim>
133  {
134  public:
138  void
139  initialize () override;
140 
141 
145  void
146  create_coarse_mesh(parallel::distributed::Triangulation<dim> &coarse_grid) const override;
147 
152  double
153  length_scale() const override;
154 
168  double
169  depth(const Point<dim> &position) const override;
170 
175  double
176  height_above_reference_surface(const Point<dim> &position) const override;
177 
181  Point<dim>
182  representative_point(const double depth) const override;
183 
189  bool
190  point_is_in_domain(const Point<dim> &point) const override;
191 
196  double
197  maximal_depth() const override;
198 
208  std::set<types::boundary_id>
209  get_used_boundary_indicators() const override;
210 
214  std::map<std::string,types::boundary_id>
215  get_symbolic_boundary_names_map() const override;
216 
221  aspect::Utilities::Coordinates::CoordinateSystem natural_coordinate_system() const override;
222 
230  std::array<double,dim> cartesian_to_natural_coordinates(const Point<dim> &position) const override;
231 
237  Point<dim> natural_to_cartesian_coordinates(const std::array<double,dim> &position) const override;
238 
242  static
243  void
245 
250  void
251  parse_parameters(ParameterHandler &prm) override;
252 
256  double
257  get_semi_minor_axis_b() const;
258 
262  double
263  get_semi_major_axis_a() const;
264 
265 
269  double
270  get_eccentricity() const;
271 
272 
280  const std::vector<Point<2>> &
281  get_corners() const;
282 
283 
288  get_manifold() const;
289 
290  private:
291  // Declare variables for reading in coordinates of the region of interest.
292  std::vector<Point<2>> corners;
294  double eccentricity;
300  double bottom_depth;
305  // Declare variables for subdividing
306  unsigned int EW_subdiv;
307  unsigned int NS_subdiv;
308  unsigned int depth_subdiv;
309 
310 
311 
323  std::unique_ptr<const internal::EllipsoidalChunkGeometry<dim>> manifold;
324 
325  void
326  set_boundary_ids(parallel::distributed::Triangulation<dim> &coarse_grid) const;
327  };
328  }
329 }
330 
331 
332 #endif
Point< 3 > push_forward(const Point< 3 > &chart_point) const override
Point< 3 > push_forward_topography(const Point< 3 > &phi_theta_d_hat) const
const std::shared_ptr< const InitialTopographyModel::Interface< dim > > topography
EllipsoidalChunkGeometry(const std::shared_ptr< const InitialTopographyModel::Interface< dim >> &topography, const double para_semi_major_axis_a, const double para_eccentricity, const double para_semi_minor_axis_b, const double para_bottom_depth, const std::vector< Point< 2 >> &para_corners)
Point< 3 > pull_back(const Point< 3 > &space_point) const override
void declare_parameters(ParameterHandler &prm)
Point< 3 > pull_back_ellipsoid(const Point< 3 > &x, const double semi_major_axis_a, const double eccentricity) const
std::unique_ptr< const internal::EllipsoidalChunkGeometry< dim > > manifold
std::unique_ptr< Manifold< dim, 3 > > clone() const override
Point< 3 > push_forward_ellipsoid(const Point< 3 > &phi_theta_d, const double semi_major_axis_a, const double eccentricity) const
Point< 3 > pull_back_topography(const Point< 3 > &phi_theta_d) const