22 #ifndef _aspect_simulator_h 23 #define _aspect_simulator_h 74 #include <boost/iostreams/tee.hpp> 75 #include <boost/iostreams/stream.hpp> 97 namespace StokesSolver
109 template <
int dim,
int velocity_degree>
112 namespace MeshDeformation
171 tensor_angular_momentum(
numbers::signaling_nan<
Tensor<1,dim>>()),
195 "Nonlinear solver failed to converge in the prescribed number of steps. " 196 "Consider changing `Max nonlinear iterations` or `Nonlinear solver failure " 223 Simulator (
const MPI_Comm mpi_communicator,
352 void setup_introspection ();
365 void set_initial_temperature_and_compositional_fields ();
382 void compute_initial_pressure_field ();
410 void compute_current_constraints ();
425 double compute_pressure_scaling_factor ()
const;
438 void start_timestep ();
447 void solve_timestep ();
460 void solve_no_advection_no_stokes ();
472 void solve_no_advection_single_stokes ();
485 void solve_no_advection_single_stokes_first_timestep_only ();
499 void solve_no_advection_iterated_stokes ();
513 void solve_no_advection_iterated_defect_correction_stokes ();
526 void solve_single_advection_no_stokes ();
539 void solve_single_advection_single_stokes ();
553 void solve_single_advection_iterated_stokes ();
567 void solve_single_advection_iterated_defect_correction_stokes ();
588 void solve_single_advection_iterated_newton_stokes (
bool use_newton_iterations);
601 void solve_iterated_advection_no_stokes ();
615 void solve_iterated_advection_and_stokes ();
630 void solve_iterated_advection_and_defect_correction_stokes ();
650 void solve_iterated_advection_and_newton_stokes (
bool use_newton_iterations);
660 void build_stokes_preconditioner ();
669 void build_advection_preconditioner (
const AdvectionField &advection_field,
671 const double diagonal_strengthening);
679 void assemble_stokes_system ();
696 double *residual =
nullptr);
713 std::vector<double> assemble_and_solve_composition (
const std::vector<double> &
initial_residual = {},
714 const unsigned int nonlinear_iteration = 0,
715 std::vector<double> *residual =
nullptr);
731 double assemble_and_solve_stokes (
const double &initial_nonlinear_residual = 0,
732 double *nonlinear_residual =
nullptr);
747 const bool use_picard);
756 void assemble_advection_system (
const AdvectionField &advection_field);
774 void interpolate_particle_properties (
const std::vector<AdvectionField> &advection_fields);
852 std::pair<double,double>
884 void refine_mesh (
const unsigned int max_grid_level);
901 unsigned int determine_last_good_snapshot()
const;
910 unsigned int determine_resume_snapshot()
const;
923 void create_snapshot(
const bool is_additional_checkpoint =
false);
938 void resume_from_snapshot();
946 template <
class Archive>
947 void serialize (Archive &ar,
const unsigned int version);
965 setup_system_matrix_coupling ()
const;
974 void setup_system_matrix (
const std::vector<IndexSet> &system_partitioning);
987 void setup_system_preconditioner (
const std::vector<IndexSet> &system_partitioning);
1020 void set_assemblers ();
1032 void set_advection_assemblers ();
1043 void set_stokes_assemblers ();
1051 void assemble_stokes_preconditioner ();
1105 local_assemble_advection_face_terms(
const AdvectionField &advection_field,
1117 local_assemble_advection_system (
const AdvectionField &advection_field,
1131 copy_local_to_global_advection_system (
const AdvectionField &advection_field,
1169 template <
typename T>
1170 void get_artificial_viscosity (
Vector<T> &viscosity_per_cell,
1172 const bool skip_interior_cells =
false)
const;
1247 void denormalize_pressure(
const double pressure_adjustment,
1258 void apply_limiter_to_dg_solutions (
const AdvectionField &advection_field);
1276 void compute_unique_advection_support_points (
const std::vector<AdvectionField> &advection_fields,
1277 std::vector<
Point<dim>> &unique_support_points,
1278 std::vector<std::vector<unsigned int>> &support_point_index_by_field)
const;
1302 void compute_reactions ();
1313 void update_solution_vectors_with_reaction_results (
const unsigned int block_index,
1327 void initialize_current_linearization_point ();
1348 void interpolate_material_output_into_advection_field (
const std::vector<AdvectionField> &adv_field);
1379 const bool use_picard,
1429 compute_net_angular_momentum(
const bool use_constant_density,
1431 const bool limit_to_top_faces =
false)
const;
1449 void remove_net_angular_momentum(
const bool use_constant_density,
1452 const bool limit_to_top_faces =
false)
const;
1461 void replace_outflow_boundary_ids(
const unsigned int boundary_id_offset,
1462 const bool is_composition,
1463 const unsigned int composition_index);
1472 void restore_outflow_boundary_ids(
const unsigned int boundary_id_offset);
1487 void remove_net_linear_momentum(
const bool use_constant_density,
1512 double get_entropy_variation (
const double average_field,
1523 std::pair<double,double>
1524 get_extrapolated_advection_field_range (
const AdvectionField &advection_field)
const;
1534 void exchange_refinement_flags();
1545 void maybe_write_timing_output ()
const;
1554 bool maybe_write_checkpoint (
const std::time_t last_checkpoint_time,
1555 const bool force_writing_checkpoint);
1573 bool maybe_do_initial_refinement (
const unsigned int max_refinement_level);
1583 void maybe_refine_mesh (
const double new_time_step,
1584 unsigned int &max_refinement_level);
1593 void advance_time (
const double step_size);
1604 const double global_u_infty,
1605 const double global_field_variation,
1606 const double average_field,
1607 const double global_entropy_variation,
1608 const double cell_diameter,
1621 const double average_field,
1623 double &max_residual,
1624 double &max_velocity,
1625 double &max_density,
1626 double &max_specific_heat,
1627 double &conductivity)
const;
1644 stokes_matrix_depends_on_solution ()
const;
1656 stokes_A_block_is_symmetric ()
const;
1667 is_stokes_matrix_free()
const;
1682 check_consistency_of_formulation ();
1690 select_default_solver_and_averaging ();
1703 check_consistency_of_boundary_conditions ()
const;
1709 compute_initial_newton_residual ();
1720 compute_Eisenstat_Walker_linear_tolerance(
const bool EisenstatWalkerChoiceOne,
1721 const double maximum_linear_stokes_solver_tolerance,
1722 const double linear_stokes_solver_tolerance,
1723 const double stokes_residual,
1724 const double newton_residual,
1725 const double newton_residual_old);
1736 void output_statistics();
1750 compute_initial_stokes_residual();
1801 using TeeDevice = boost::iostreams::tee_device<std::ostream, std::ofstream>;
1919 #ifdef ASPECT_WITH_WORLD_BUILDER 1931 std::shared_ptr<WorldBuilder::World> world_builder;
2155 friend class boost::serialization::access;
The NullspaceRemoval struct.
unsigned int nonlinear_iteration
BoundaryVelocity::Manager< dim > boundary_velocity_manager
const std::unique_ptr< AdiabaticConditions::Interface< dim > > adiabatic_conditions
unsigned int linear_solver_failures
std::shared_ptr< InitialComposition::Manager< dim > > initial_composition_manager
void write_plugin_graph(std::ostream &output_stream)
parallel::distributed::Triangulation< dim > triangulation
TimerOutput computing_timer
BoundaryTemperature::Manager< dim > boundary_temperature_manager
boost::iostreams::tee_device< std::ostream, std::ofstream > TeeDevice
double scalar_moment_of_inertia
Tensor< 1, dim > tensor_rotation
Tensor< 1, dim > tensor_angular_momentum
AffineConstraints< double > constraints
bool assemble_newton_stokes_system
double scalar_angular_momentum
LinearAlgebra::BlockVector old_solution
const IntermediaryConstructorAction post_geometry_model_creation_action
std::unique_ptr< VolumeOfFluidHandler< dim > > volume_of_fluid_handler
bool rebuild_stokes_matrix
Parameters< dim > parameters
SymmetricTensor< 2, dim > tensor_moment_of_inertia
AffineConstraints< double > current_constraints
std::unique_ptr< MeshDeformation::MeshDeformationHandler< dim > > mesh_deformation
LinearAlgebra::BlockVector system_rhs
std::pair< double, double > stokes_residuals
std::vector< Particle::Manager< dim > > particle_managers
std::thread output_statistics_thread
LateralAveraging< dim > lateral_averaging
DeclExceptionMsg(ExcNonlinearSolverNoConvergence, "Nonlinear solver failed to converge in the prescribed number of steps. " "Consider changing `Max nonlinear iterations` or `Nonlinear solver failure " "strategy`.")
TeeStream iostream_tee_stream
MeshRefinement::Manager< dim > mesh_refinement_manager
std::size_t statistics_last_write_size
const std::unique_ptr< MaterialModel::Interface< dim > > material_model
#define DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
unsigned int nonlinear_solver_failures
double last_pressure_normalization_adjustment
double total_walltime_until_last_snapshot
void declare_parameters(ParameterHandler &prm)
const std::unique_ptr< GeometryModel::Interface< dim > > geometry_model
LinearAlgebra::BlockVector operator_split_reaction_vector
unsigned int last_regular_checkpoint_id
DoFHandler< dim > dof_handler
unsigned int last_checkpoint_id
std::unique_ptr< Assemblers::Manager< dim > > assemblers
bool rebuild_sparsity_and_matrices
const IntermediaryConstructorAction post_signal_creation
double global_Omega_diameter
unsigned int timestep_number
bool assemble_newton_stokes_matrix
unsigned int pre_refinement_step
TimeStepping::Manager< dim > time_stepping_manager
std::size_t statistics_last_hash
Introspection< dim > introspection
MPI_Comm mpi_communicator
typename Parameters< dim >::NullspaceRemoval NullspaceRemoval
LinearAlgebra::BlockSparseMatrix system_preconditioner_matrix
bool do_pressure_rhs_compatibility_modification
LinearAlgebra::BlockVector current_linearization_point
BoundaryConvectiveHeating::Manager< dim > boundary_convective_heating_manager
LinearAlgebra::BlockVector old_old_solution
BoundaryTraction::Manager< dim > boundary_traction_manager
LinearAlgebra::BlockVector pressure_shape_function_integrals
unsigned int last_additional_checkpoint_id
std::ofstream log_file_stream
std::unique_ptr< LinearAlgebra::PreconditionAMG > Amg_preconditioner
std::unique_ptr< StokesSolver::Interface< dim > > stokes_solver
std::shared_ptr< InitialTemperature::Manager< dim > > initial_temperature_manager
TeeDevice iostream_tee_device
boost::iostreams::stream< TeeDevice > TeeStream
LinearAlgebra::BlockSparseMatrix system_matrix
#define DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
std::unique_ptr< MeltHandler< dim > > melt_handler
LinearAlgebra::BlockVector inverse_lumped_mass_matrix
bool rebuild_stokes_preconditioner
PrescribedSolution::Manager< dim > prescribed_solution_manager
const std::shared_ptr< InitialTopographyModel::Interface< dim > > initial_topography_model
std::unique_ptr< Mapping< dim > > mapping
const std::unique_ptr< PrescribedStokesSolution::Interface< dim > > prescribed_stokes_solution
double switch_initial_residual
HeatingModel::Manager< dim > heating_model_manager
SimulatorSignals< dim > signals
const std::unique_ptr< BoundaryHeatFlux::Interface< dim > > boundary_heat_flux
const FESystem< dim > finite_element
bool simulator_is_past_initialization
LinearAlgebra::BlockVector solution
std::unique_ptr< NewtonHandler< dim > > newton_handler
typename Parameters< dim >::NonlinearSolver NonlinearSolver
PrescribedDilation::Manager< dim > prescribed_dilation_manager
Postprocess::Manager< dim > postprocess_manager
const std::unique_ptr< GravityModel::Interface< dim > > gravity_model
double newton_residual_for_derivative_scaling_factor
BoundaryComposition::Manager< dim > boundary_composition_manager
std::unique_ptr< LinearAlgebra::PreconditionBase > Mp_preconditioner