20#ifndef lethe_continuum_solid_dynamics_h
21#define lethe_continuum_solid_dynamics_h
33#include <deal.II/base/exceptions.h>
34#include <deal.II/base/index_set.h>
35#include <deal.II/base/quadrature.h>
36#include <deal.II/base/timer.h>
38#include <deal.II/distributed/tria_base.h>
40#include <deal.II/dofs/dof_handler.h>
42#include <deal.II/fe/fe.h>
43#include <deal.II/fe/fe_values_extractors.h>
44#include <deal.II/fe/mapping.h>
46#include <deal.II/lac/affine_constraints.h>
47#include <deal.II/lac/trilinos_sparse_matrix.h>
49#include <deal.II/numerics/solution_transfer.h>
60 ContinuumSolidDynamicsWithoutVANSError,
61 "The \"continuum solid dynamics\" physics (Euler-Euler model) is enabled, but the fluid "
62 "dynamics solver does not solve the volume-averaged Navier-Stokes (VANS) "
63 "equations. The solid phase can only be used with a VANS solver.");
90 const std::shared_ptr<parallel::DistributedTriangulationBase<dim>>
92 const std::shared_ptr<SimulationControl> &p_simulation_control);
99 std::vector<OutputStruct<dim, GlobalVectorType>>
149 const std::pair<const Variable, Parameters::MultipleAdaptationParameters>
151 dealii::Vector<float> &estimated_error_per_cell)
override;
170 std::vector<OutputStructTableHandler>
209 const DoFHandler<dim> &
275 AffineConstraints<double> &
334 std::shared_ptr<FiniteElement<dim>>
fe;
364 std::vector<SolutionTransfer<dim, GlobalVectorType>>
AuxiliaryPhysics(const Parameters::NonLinearSolver non_linear_solver_parameters)
std::shared_ptr< SimulationControl > simulation_control
Simulation control.
std::shared_ptr< SolutionTransfer< dim, GlobalVectorType > > solution_transfer
Solution transfer for mesh adaptation and checkpointing.
std::shared_ptr< DoFHandler< dim > > dof_handler
DoFHandler of the solid phase.
std::vector< SolutionTransfer< dim, GlobalVectorType > > previous_solutions_transfer
GlobalVectorType system_rhs
void compute_error_estimate(const std::pair< const Variable, Parameters::MultipleAdaptationParameters > &ivar, dealii::Vector< float > &estimated_error_per_cell) override
Compute the error estimate used for mesh adaptation. Not supported yet for the solid phase.
AffineConstraints< double > & get_nonzero_constraints() override
Get the non-zero constraints.
TimerOutput computing_timer
Timer of the solid phase physics.
void solve_linear_system() override
Solve the linear system. Not implemented yet.
GlobalVectorType & get_evaluation_point() override
Get the evaluation point.
void assemble_system_rhs() override
Assemble the system right-hand side. Not implemented yet.
GlobalVectorType & get_local_evaluation_point() override
Get the local (non-ghosted) evaluation point.
const SimulationParameters< dim > & simulation_parameters
Simulation parameters.
std::shared_ptr< FiniteElement< dim > > fe
FESystem: dim velocity components + 1 volume fraction component.
const DoFHandler< dim > & get_dof_handler() override
Get the DoFHandler of the solid phase.
TrilinosWrappers::SparseMatrix system_matrix
std::vector< OutputStructTableHandler > gather_tables() override
Gather the post-processing tables to serialize. None yet.
void pre_mesh_adaptation() override
Prepare the solution vectors for mesh refinement/coarsening.
std::vector< OutputStruct< dim, GlobalVectorType > > gather_output_hook() override
Gather the solid velocity and solid volume fraction for output.
ContinuumSolidDynamics(MultiphysicsInterface< dim > *multiphysics_interface, const SimulationParameters< dim > &p_simulation_parameters, const std::shared_ptr< parallel::DistributedTriangulationBase< dim > > &p_triangulation, const std::shared_ptr< SimulationControl > &p_simulation_control)
Constructor of the solid phase physics.
std::shared_ptr< parallel::DistributedTriangulationBase< dim > > triangulation
Triangulation shared by all physics.
void set_initial_conditions() override
Set the initial conditions. Fields are set to zero for now.
std::shared_ptr< std::vector< GlobalVectorType > > previous_solutions
Previous solutions for the BDF time-stepping schemes.
double get_residual_rescale_metric() const override
Get the metric used to rescale the residual.
void write_checkpoint() override
Serialize the present and previous solutions for restart.
void percolate_time_vectors() override
Shift the solution history for the BDF time-stepping schemes.
IndexSet locally_relevant_dofs
std::shared_ptr< Quadrature< dim - 1 > > face_quadrature
AffineConstraints< double > zero_constraints
GlobalVectorType local_evaluation_point
void setup_dofs() override
Distribute the DoFs, allocate the vectors and matrix, and register the solid phase fields in the mult...
const FEValuesExtractors::Scalar solid_volume_fraction_extractor
void post_mesh_adaptation() override
Interpolate the solution vectors onto the adapted mesh.
std::shared_ptr< GlobalVectorType > present_solution
bool should_solve_auxiliary_physics() override
Indicate whether the solid phase should be solved. Returns false until the governing equations are im...
void read_checkpoint() override
Deserialize the present and previous solutions for restart.
IndexSet locally_owned_dofs
Locally owned and locally relevant DoFs.
std::shared_ptr< Quadrature< dim > > cell_quadrature
void finish_simulation() override
Finish the simulation (print timers).
const FEValuesExtractors::Vector solid_velocity_extractor
Extractors of the solid velocity and solid volume fraction.
GlobalVectorType & get_newton_update() override
Get the Newton update.
GlobalVectorType evaluation_point
Solution and solver vectors.
AffineConstraints< double > nonzero_constraints
void define_constraints()
Define the constraints (hanging nodes only for now).
GlobalVectorType & get_present_solution() override
Get the present solution.
std::shared_ptr< Mapping< dim > > mapping
Mapping, cell and face quadratures.
GlobalVectorType newton_update
void postprocess(bool first_iteration) override
Post-process the solid phase solution. Nothing is computed yet.
void output_per_iteration_timer() override
Print the timer summary at each iteration.
void output_newton_update_norms() override
Print the norms of the Newton update.
GlobalVectorType & get_system_rhs() override
Get the system right-hand side.
MultiphysicsInterface< dim > * multiphysics
Multiphysics interface used to exchange fields with other physics.
void assemble_system_matrix() override
Assemble the system matrix. Not implemented yet.
DeclExceptionMsg(ContinuumSolidDynamicsWithoutVANSError, "The \"continuum solid dynamics\" physics (Euler-Euler model) is enabled, but the fluid " "dynamics solver does not solve the volume-averaged Navier-Stokes (VANS) " "equations. The solid phase can only be used with a VANS solver.")
Exception thrown when the solid phase is enabled with a fluid dynamics solver that does not solve the...
Identifiers for multiphysics modules and their solution fields.
Simulation control classes for managing time-stepping and iteration control in Lethe.
dealii::TrilinosWrappers::MPI::Vector GlobalVectorType