ASPECT
simulator_access.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_simulator_access_h
23 #define _aspect_simulator_access_h
24 
25 #include <aspect/global.h>
26 #include <aspect/parameters.h>
27 #include <aspect/introspection.h>
28 
30 #include <deal.II/base/timer.h>
34 #include <deal.II/fe/fe.h>
35 #include <deal.II/fe/mapping_q.h>
37 
38 namespace WorldBuilder
39 {
40  class World;
41 }
42 
43 namespace aspect
44 {
45  // forward declarations:
46  template <int dim> class Simulator;
47  template <int dim> struct SimulatorSignals;
48  template <int dim> class LateralAveraging;
49  template <int dim> struct RotationProperties;
50 
51  namespace GravityModel
52  {
53  template <int dim> class Interface;
54  }
55 
56  namespace HeatingModel
57  {
58  template <int dim> class Manager;
59  }
60 
61  namespace MaterialModel
62  {
63  template <int dim> class Interface;
64  }
65 
66  namespace InitialTemperature
67  {
68  template <int dim> class Manager;
69  template <int dim> class Interface;
70  }
71 
72  namespace BoundaryTemperature
73  {
74  template <int dim> class Manager;
75  template <int dim> class Interface;
76  }
77 
78  namespace BoundaryHeatFlux
79  {
80  template <int dim> class Interface;
81  }
82 
83  namespace BoundaryConvectiveHeating
84  {
85  template <int dim> class Manager;
86  template <int dim> class Interface;
87  }
88 
89  namespace BoundaryComposition
90  {
91  template <int dim> class Manager;
92  template <int dim> class Interface;
93  }
94 
95  namespace BoundaryTraction
96  {
97  template <int dim> class Manager;
98  template <int dim> class Interface;
99  }
100 
101  namespace BoundaryVelocity
102  {
103  template <int dim> class Manager;
104  template <int dim> class Interface;
105  }
106 
107  namespace InitialComposition
108  {
109  template <int dim> class Manager;
110  template <int dim> class Interface;
111  }
112 
113  namespace InitialTopographyModel
114  {
115  template <int dim> class Interface;
116  }
117 
118  namespace MeshRefinement
119  {
120  template <int dim> class Manager;
121  }
122 
123  namespace AdiabaticConditions
124  {
125  template <int dim> class Interface;
126  }
127 
128  namespace Postprocess
129  {
130  template <int dim> class Manager;
131  }
132 
133  template <int dim> class MeltHandler;
134  template <int dim> class VolumeOfFluidHandler;
135 
136  namespace MeshDeformation
137  {
138  template <int dim> class MeshDeformationHandler;
139  }
140 
141  template <int dim> class NewtonHandler;
142 
143  template <int dim> class StokesMatrixFreeHandler;
144 
145  namespace Particle
146  {
147  template <int dim> class Manager;
148  }
149 
150  namespace TimeStepping
151  {
152  template <int dim> class Manager;
153  }
154 
155  namespace PrescribedSolution
156  {
157  template <int dim> class Manager;
158  }
159 
209  template <int dim>
211  {
212  public:
220 
225  SimulatorAccess (const Simulator<dim> &simulator_object);
226 
231  virtual ~SimulatorAccess ();
232 
242  virtual void initialize_simulator (const Simulator<dim> &simulator_object);
243 
254  const Introspection<dim> &
255  introspection () const;
256 
264  const Simulator<dim> &
265  get_simulator () const;
266 
271  const Parameters<dim> &
272  get_parameters () const;
273 
278  get_signals() const;
279 
283  MPI_Comm
285 
292  TimerOutput &
294 
300  const ConditionalOStream &
301  get_pcout () const;
302 
306  double get_time () const;
307 
311  double
312  get_timestep () const;
313 
317  double
319 
323  unsigned int
325 
333 
337  unsigned int
339 
346 
350  double
351  get_volume () const;
352 
357  const Mapping<dim> &
358  get_mapping () const;
359 
365  std::string
367 
374  unsigned int
376 
380  bool
382 
386  bool
388 
392  bool
394 
398  int
400 
404  double
406 
410  double
412 
418  bool
420 
430  unsigned int
432 
437  unsigned int
439 
443  double
444  get_end_time () const;
445 
452  void
453  get_refinement_criteria(Vector<float> &estimated_error_per_cell) const;
454 
465  void
467  const bool skip_interior_cells = false) const;
468 
473  void
475  const unsigned int compositional_variable) const;
495 
507  get_solution () const;
508 
519 
530 
540 
550 
555  const DoFHandler<dim> &
556  get_dof_handler () const;
557 
566  const FiniteElement<dim> &
567  get_fe () const;
568 
574 
580 
593 
599 
605 
611  const std::shared_ptr<const InitialTopographyModel::Interface<dim>>
613 
619 
620 
627 
637 
646 
655 
662 
671 
680 
689 
716  std::shared_ptr<const InitialTemperature::Manager<dim>>
718 
735 
761  std::shared_ptr<const InitialComposition::Manager<dim>>
763 
780 
785  const std::set<types::boundary_id> &
787 
792  const std::set<types::boundary_id> &
794 
799  const std::set<types::boundary_id> &
801 
806  const std::set<types::boundary_id> &
808 
815  const std::set<types::boundary_id> &
817 
826 
834 
843 
847  const MeltHandler<dim> &
849 
855 
860  const NewtonHandler<dim> &
862 
863 #ifdef ASPECT_WITH_WORLD_BUILDER
880  const WorldBuilder::World &
881  get_world_builder () const;
882 
892  std::shared_ptr<const WorldBuilder::World>
893  get_world_builder_pointer () const;
894 #endif
901 
907  const LateralAveraging<dim> &
909 
916 
950 
955  double
957 
964  bool
966 
970  bool
972 
978  static
979  void
980  get_composition_values_at_q_point (const std::vector<std::vector<double>> &composition_values,
981  const unsigned int q,
982  std::vector<double> &composition_values_at_q_point);
983 
996 
1002 
1006  unsigned int
1008 
1013  const Particle::Manager<dim> &
1014  get_particle_manager(const unsigned int particle_manager_index) const;
1015 
1023  get_particle_manager(const unsigned int particle_manager_index);
1024 
1029 
1036 
1043 
1056  compute_net_angular_momentum(const bool use_constant_density,
1057  const LinearAlgebra::BlockVector &solution,
1058  const bool limit_to_top_faces = false) const;
1059 
1070  LinearAlgebra::BlockVector &distributed_stokes_solution) const;
1071 
1085 
1096  void denormalize_pressure(const double pressure_adjustment,
1097  LinearAlgebra::BlockVector &vector) const;
1098 
1101  private:
1106  };
1107 }
1108 
1109 
1110 #endif
const LinearAlgebra::BlockVector & get_current_linearization_point() const
const BoundaryVelocity::Manager< dim > & get_boundary_velocity_manager() const
const VolumeOfFluidHandler< dim > & get_volume_of_fluid_handler() const
bool simulator_is_past_initialization() const
const Mapping< dim > & get_mapping() const
const Parameters< dim > & get_parameters() const
double get_timestep() const
bool model_has_prescribed_stokes_solution() const
const BoundaryTemperature::Manager< dim > & get_boundary_temperature_manager() const
const InitialTemperature::Manager< dim > & get_initial_temperature_manager() const
bool include_adiabatic_heating() const
const StokesMatrixFreeHandler< dim > & get_stokes_matrix_free() const
const ConditionalOStream & get_pcout() const
const Introspection< dim > & introspection() const
double get_end_time() const
unsigned int n_compositional_fields() const
const MaterialModel::Interface< dim > & get_material_model() const
const GravityModel::Interface< dim > & get_gravity_model() const
bool has_boundary_composition() const
unsigned int get_checkpoint_id() const
bool include_latent_heat() const
const GeometryModel::Interface< dim > & get_geometry_model() const
const InitialComposition::Manager< dim > & get_initial_composition_manager() const
const LinearAlgebra::BlockSparseMatrix & get_system_matrix() const
const parallel::distributed::Triangulation< dim > & get_triangulation() const
const AffineConstraints< double > & get_current_constraints() const
const Postprocess::Manager< dim > & get_postprocess_manager() const
const std::set< types::boundary_id > & get_fixed_temperature_boundary_indicators() const
const NewtonHandler< dim > & get_newton_handler() const
const LinearAlgebra::BlockSparseMatrix & get_system_preconditioner_matrix() const
double get_pressure_scaling() const
std::shared_ptr< const InitialTemperature::Manager< dim > > get_initial_temperature_manager_pointer() const
Particle::Manager< dim > & get_particle_manager(const unsigned int particle_manager_index)
SimulatorSignals< dim > & get_signals() const
void remove_nullspace(LinearAlgebra::BlockVector &solution, LinearAlgebra::BlockVector &distributed_stokes_solution) const
const TimeStepping::Manager< dim > & get_timestepping_manager() const
const BoundaryComposition::Manager< dim > & get_boundary_composition_manager() const
const LinearAlgebra::BlockVector & get_reaction_vector() const
static void get_composition_values_at_q_point(const std::vector< std::vector< double >> &composition_values, const unsigned int q, std::vector< double > &composition_values_at_q_point)
SimulatorAccess(const Simulator< dim > &simulator_object)
const HeatingModel::Manager< dim > & get_heating_model_manager() const
virtual void initialize_simulator(const Simulator< dim > &simulator_object)
bool convert_output_to_years() const
const MeshDeformation::MeshDeformationHandler< dim > & get_mesh_deformation_handler() const
const std::set< types::boundary_id > & get_fixed_composition_boundary_indicators() const
unsigned int get_nonlinear_iteration() const
const MeshRefinement::Manager< dim > & get_mesh_refinement_manager() const
const LinearAlgebra::BlockVector & get_solution() const
const AdiabaticConditions::Interface< dim > & get_adiabatic_conditions() const
bool include_melt_transport() const
double get_adiabatic_surface_temperature() const
const std::shared_ptr< const InitialTopographyModel::Interface< dim > > get_initial_topography_model_pointer() const
bool has_boundary_temperature() const
void get_artificial_viscosity(Vector< float > &viscosity_per_cell, const bool skip_interior_cells=false) const
ObserverPointer< const Simulator< dim >, SimulatorAccess< dim > > simulator
const BoundaryHeatFlux::Interface< dim > & get_boundary_heat_flux() const
double get_time() const
std::string get_output_directory() const
const LinearAlgebra::BlockVector & get_old_solution() const
TableHandler & get_statistics_object() const
double get_old_timestep() const
const InitialTopographyModel::Interface< dim > & get_initial_topography_model() const
double normalize_pressure(LinearAlgebra::BlockVector &vector) const
void get_artificial_viscosity_composition(Vector< float > &viscosity_per_cell, const unsigned int compositional_variable) const
unsigned int n_particle_managers() const
unsigned int get_pre_refinement_step() const
const BoundaryConvectiveHeating::Manager< dim > & get_boundary_convective_heating_manager() const
const std::set< types::boundary_id > & get_fixed_heat_flux_boundary_indicators() const
const Particle::Manager< dim > & get_particle_manager(const unsigned int particle_manager_index) const
void get_refinement_criteria(Vector< float > &estimated_error_per_cell) const
const std::set< types::boundary_id > & get_fixed_convective_heating_boundary_indicators() const
const LinearAlgebra::BlockVector & get_old_old_solution() const
double get_volume() const
MPI_Comm get_mpi_communicator() const
unsigned int get_timestep_number() const
const LateralAveraging< dim > & get_lateral_averaging() const
const FiniteElement< dim > & get_fe() const
int get_stokes_velocity_degree() const
const PrescribedSolution::Manager< dim > & get_prescribed_solution() const
std::shared_ptr< const InitialComposition::Manager< dim > > get_initial_composition_manager_pointer() const
bool pressure_rhs_needs_compatibility_modification() const
const DoFHandler< dim > & get_dof_handler() const
TimerOutput & get_computing_timer() const
void denormalize_pressure(const double pressure_adjustment, LinearAlgebra::BlockVector &vector) const
const MeltHandler< dim > & get_melt_handler() const
const std::set< types::boundary_id > & get_mesh_deformation_boundary_indicators() const
const LinearAlgebra::BlockVector & get_mesh_velocity() const
RotationProperties< dim > compute_net_angular_momentum(const bool use_constant_density, const LinearAlgebra::BlockVector &solution, const bool limit_to_top_faces=false) const
double get_surface_pressure() const
const BoundaryTraction::Manager< dim > & get_boundary_traction_manager() const
const Simulator< dim > & get_simulator() const
Manager< dim > World
Definition: world.h:39