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
103 template <
int dim,
int velocity_degree>
106 namespace MeshDeformation
165 tensor_angular_momentum(
numbers::signaling_nan<
Tensor<1,dim>>()),
189 "Nonlinear solver failed to converge in the prescribed number of steps. " 190 "Consider changing `Max nonlinear iterations` or `Nonlinear solver failure " 217 Simulator (
const MPI_Comm mpi_communicator,
346 void setup_introspection ();
359 void set_initial_temperature_and_compositional_fields ();
376 void compute_initial_pressure_field ();
404 void compute_current_constraints ();
419 double compute_pressure_scaling_factor ()
const;
432 void start_timestep ();
441 void solve_timestep ();
454 void solve_no_advection_no_stokes ();
466 void solve_no_advection_single_stokes ();
479 void solve_no_advection_single_stokes_first_timestep_only ();
493 void solve_no_advection_iterated_stokes ();
507 void solve_no_advection_iterated_defect_correction_stokes ();
520 void solve_single_advection_no_stokes ();
533 void solve_single_advection_single_stokes ();
547 void solve_single_advection_iterated_stokes ();
561 void solve_single_advection_iterated_defect_correction_stokes ();
582 void solve_single_advection_iterated_newton_stokes (
bool use_newton_iterations);
595 void solve_iterated_advection_no_stokes ();
609 void solve_iterated_advection_and_stokes ();
624 void solve_iterated_advection_and_defect_correction_stokes ();
644 void solve_iterated_advection_and_newton_stokes (
bool use_newton_iterations);
654 void build_stokes_preconditioner ();
663 void build_advection_preconditioner (
const AdvectionField &advection_field,
665 const double diagonal_strengthening);
673 void assemble_stokes_system ();
690 double *residual =
nullptr);
707 std::vector<double> assemble_and_solve_composition (
const std::vector<double> &
initial_residual = {},
708 const unsigned int nonlinear_iteration = 0,
709 std::vector<double> *residual =
nullptr);
725 double assemble_and_solve_stokes (
const double &initial_nonlinear_residual = 0,
726 double *nonlinear_residual =
nullptr);
741 const bool use_picard);
750 void assemble_advection_system (
const AdvectionField &advection_field);
768 void interpolate_particle_properties (
const std::vector<AdvectionField> &advection_fields);
846 std::pair<double,double>
878 void refine_mesh (
const unsigned int max_grid_level);
895 unsigned int determine_last_good_snapshot()
const;
904 unsigned int determine_resume_snapshot()
const;
917 void create_snapshot(
const bool is_additional_checkpoint =
false);
932 void resume_from_snapshot();
940 template <
class Archive>
941 void serialize (Archive &ar,
const unsigned int version);
959 setup_system_matrix_coupling ()
const;
968 void setup_system_matrix (
const std::vector<IndexSet> &system_partitioning);
981 void setup_system_preconditioner (
const std::vector<IndexSet> &system_partitioning);
1014 void set_assemblers ();
1026 void set_advection_assemblers ();
1037 void set_stokes_assemblers ();
1045 void assemble_stokes_preconditioner ();
1099 local_assemble_advection_face_terms(
const AdvectionField &advection_field,
1111 local_assemble_advection_system (
const AdvectionField &advection_field,
1125 copy_local_to_global_advection_system (
const AdvectionField &advection_field,
1163 template <
typename T>
1164 void get_artificial_viscosity (
Vector<T> &viscosity_per_cell,
1166 const bool skip_interior_cells =
false)
const;
1241 void denormalize_pressure(
const double pressure_adjustment,
1252 void apply_limiter_to_dg_solutions (
const AdvectionField &advection_field);
1270 void compute_unique_advection_support_points (
const std::vector<AdvectionField> &advection_fields,
1271 std::vector<
Point<dim>> &unique_support_points,
1272 std::vector<std::vector<unsigned int>> &support_point_index_by_field)
const;
1296 void compute_reactions ();
1307 void update_solution_vectors_with_reaction_results (
const unsigned int block_index,
1321 void initialize_current_linearization_point ();
1342 void interpolate_material_output_into_advection_field (
const std::vector<AdvectionField> &adv_field);
1373 const bool use_picard,
1423 compute_net_angular_momentum(
const bool use_constant_density,
1425 const bool limit_to_top_faces =
false)
const;
1443 void remove_net_angular_momentum(
const bool use_constant_density,
1446 const bool limit_to_top_faces =
false)
const;
1455 void replace_outflow_boundary_ids(
const unsigned int boundary_id_offset,
1456 const bool is_composition,
1457 const unsigned int composition_index);
1466 void restore_outflow_boundary_ids(
const unsigned int boundary_id_offset);
1481 void remove_net_linear_momentum(
const bool use_constant_density,
1506 double get_entropy_variation (
const double average_field,
1517 std::pair<double,double>
1518 get_extrapolated_advection_field_range (
const AdvectionField &advection_field)
const;
1528 void exchange_refinement_flags();
1539 void maybe_write_timing_output ()
const;
1548 bool maybe_write_checkpoint (
const std::time_t last_checkpoint_time,
1549 const bool force_writing_checkpoint);
1567 bool maybe_do_initial_refinement (
const unsigned int max_refinement_level);
1577 void maybe_refine_mesh (
const double new_time_step,
1578 unsigned int &max_refinement_level);
1587 void advance_time (
const double step_size);
1598 const double global_u_infty,
1599 const double global_field_variation,
1600 const double average_field,
1601 const double global_entropy_variation,
1602 const double cell_diameter,
1615 const double average_field,
1617 double &max_residual,
1618 double &max_velocity,
1619 double &max_density,
1620 double &max_specific_heat,
1621 double &conductivity)
const;
1638 stokes_matrix_depends_on_solution ()
const;
1650 stokes_A_block_is_symmetric ()
const;
1665 check_consistency_of_formulation ();
1673 select_default_solver_and_averaging ();
1686 check_consistency_of_boundary_conditions ()
const;
1692 compute_initial_newton_residual ();
1703 compute_Eisenstat_Walker_linear_tolerance(
const bool EisenstatWalkerChoiceOne,
1704 const double maximum_linear_stokes_solver_tolerance,
1705 const double linear_stokes_solver_tolerance,
1706 const double stokes_residual,
1707 const double newton_residual,
1708 const double newton_residual_old);
1719 void output_statistics();
1733 compute_initial_stokes_residual();
1784 using TeeDevice = boost::iostreams::tee_device<std::ostream, std::ofstream>;
1902 #ifdef ASPECT_WITH_WORLD_BUILDER 1914 std::shared_ptr<WorldBuilder::World> world_builder;
2144 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
std::unique_ptr< StokesSolver::Direct< dim > > stokes_direct
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
std::unique_ptr< StokesMatrixFreeHandler< dim > > stokes_matrix_free
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::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