![]() |
Lethe Open-Source Library version 1.2.0
Developer Guide
|
#include <fluid_dynamics_matrix_free.h>
Public Member Functions | |
| MFNavierStokesPreconditionGMGBase (const SimulationParameters< dim > &simulation_parameters, const DoFHandler< dim > &dof_handler, const DoFHandler< dim > &dof_handler_fe_q_iso_q1) | |
| virtual | ~MFNavierStokesPreconditionGMGBase ()=default |
| void | reinit (const std::shared_ptr< Mapping< dim > > &mapping, const std::shared_ptr< Quadrature< dim > > &cell_quadrature, const std::shared_ptr< Function< dim > > &forcing_function, const std::shared_ptr< SimulationControl > &simulation_control, const std::shared_ptr< PhysicalPropertiesManager > &physical_properties_manager, const std::shared_ptr< FESystem< dim > > &fe) |
| virtual void | create_level_operator (const unsigned int level)=0 |
| void | initialize () |
| void | vmult (VectorType &dst, const VectorType &src) const |
| void | print_relevant_info () const |
| const MGLevelObject< std::shared_ptr< OperatorType > > & | get_mg_operators () const |
| const MGLevelObject< std::shared_ptr< PreconditionBase< MGVectorType > > > & | get_mg_smoother_preconditioners () const |
Public Attributes | |
| TimerOutput | mg_setup_timer |
| TimerOutput | mg_vmult_timer |
Protected Types | |
| using | Number = double |
| using | MGNumber = double |
| using | VectorType = LinearAlgebra::distributed::Vector<Number> |
| using | MGVectorType = LinearAlgebra::distributed::Vector<MGNumber> |
| using | TrilinosVectorType = LinearAlgebra::distributed::Vector<double> |
| using | LSTransferType = MGTransferMatrixFreeWrapper<dim, MGNumber> |
| using | GCTransferType = MGTransferGlobalCoarsening<dim, MGVectorType> |
| using | OperatorType = NavierStokesOperatorBase<dim, MGNumber> |
| using | SmootherPreconditionerType = PreconditionBase<MGVectorType> |
| using | SmootherType |
| using | ChebyshevSmootherType |
| using | PreconditionerTypeLS |
| using | PreconditionerTypeGC |
| using | CoarseGridSolverApply |
Protected Member Functions | |
| void | setup_AMG () |
| void | setup_ILU () |
Protected Attributes | |
| unsigned int | minlevel |
| unsigned int | maxlevel |
| unsigned int | intlevel |
| std::vector< std::shared_ptr< const Triangulation< dim > > > | coarse_grid_triangulations |
| MGLevelObject< DoFHandler< dim > > | dof_handlers |
| MGLevelObject< std::shared_ptr< MappingQCache< dim > > > | mappings |
| MGLevelObject< MGTwoLevelTransfer< dim, MGVectorType > > | transfers |
| MGLevelObject< std::shared_ptr< OperatorType > > | mg_operators |
| std::shared_ptr< mg::Matrix< MGVectorType > > | mg_matrix |
| std::shared_ptr< mg::Matrix< MGVectorType > > | mg_interface_matrix_in |
| MGLevelObject< MatrixFreeOperators::MGInterfaceOperator< OperatorType > > | ls_mg_operators |
| MGLevelObject< MatrixFreeOperators::MGInterfaceOperator< OperatorType > > | ls_mg_interface_in |
| MGLevelObject< std::shared_ptr< PreconditionBase< MGVectorType > > > | mg_smoother_preconditioners |
| std::shared_ptr< MGSmootherBase< MGVectorType > > | mg_smoother |
| MGLevelObject< MGConstrainedDoFs > | mg_constrained_dofs |
| std::shared_ptr< LSTransferType > | mg_transfer_ls |
| std::shared_ptr< GCTransferType > | mg_transfer_gc |
| std::shared_ptr< PreconditionAdapter< MGVectorType, TrilinosVectorType > > | coarse_grid_precondition |
| std::shared_ptr< SolverControl > | coarse_grid_solver_control |
| std::shared_ptr< SolverControl > | direct_solver_control |
| std::shared_ptr< SolverGMRES< TrilinosVectorType > > | coarse_grid_solver |
| std::shared_ptr< MGCoarseGridBase< MGVectorType > > | mg_coarse |
| std::shared_ptr< SolverControl > | coarse_grid_solver_control_intermediate |
| std::shared_ptr< MGCoarseGridBase< MGVectorType > > | mg_coarse_intermediate |
| std::shared_ptr< SolverGMRES< MGVectorType > > | coarse_grid_solver_intermediate |
| std::shared_ptr< Multigrid< MGVectorType > > | mg_intermediate |
| std::shared_ptr< PreconditionMG< dim, MGVectorType, GCTransferType > > | gc_multigrid_preconditioner_intermediate |
| std::shared_ptr< PreconditionMG< dim, MGVectorType, LSTransferType > > | ls_multigrid_preconditioner_intermediate |
| std::shared_ptr< Multigrid< MGVectorType > > | mg |
| std::shared_ptr< PreconditionMG< dim, MGVectorType, LSTransferType > > | ls_multigrid_preconditioner |
| std::shared_ptr< PreconditionMG< dim, MGVectorType, GCTransferType > > | gc_multigrid_preconditioner |
| ConditionalOStream | pcout |
| SimulationParameters< dim > | simulation_parameters |
| const DoFHandler< dim > & | dof_handler |
| DoFHandler< dim > | dof_handler_fe_q_iso_q1 |
| std::vector< unsigned int > | coarse_grid_iterations |
| MGLevelObject< DoFHandler< dim > > | temperature_dof_handlers |
| MGLevelObject< MGTwoLevelTransfer< dim, MGVectorType > > | transfers_temperature |
| std::shared_ptr< GCTransferType > | mg_transfer_gc_temperature |
| bool | use_manifold_for_normal |
A geometric multigrid preconditioner compatible with the matrix-free solver.
Definition at line 47 of file fluid_dynamics_matrix_free.h.
|
protected |
Definition at line 71 of file fluid_dynamics_matrix_free.h.
|
protected |
Definition at line 80 of file fluid_dynamics_matrix_free.h.
|
protected |
Definition at line 65 of file fluid_dynamics_matrix_free.h.
|
protected |
Definition at line 61 of file fluid_dynamics_matrix_free.h.
|
protected |
Definition at line 53 of file fluid_dynamics_matrix_free.h.
|
protected |
Definition at line 59 of file fluid_dynamics_matrix_free.h.
|
protected |
Definition at line 50 of file fluid_dynamics_matrix_free.h.
|
protected |
Definition at line 67 of file fluid_dynamics_matrix_free.h.
|
protected |
Definition at line 77 of file fluid_dynamics_matrix_free.h.
|
protected |
Definition at line 75 of file fluid_dynamics_matrix_free.h.
|
protected |
Definition at line 68 of file fluid_dynamics_matrix_free.h.
|
protected |
Definition at line 69 of file fluid_dynamics_matrix_free.h.
|
protected |
Definition at line 60 of file fluid_dynamics_matrix_free.h.
|
protected |
Definition at line 58 of file fluid_dynamics_matrix_free.h.
| MFNavierStokesPreconditionGMGBase< dim >::MFNavierStokesPreconditionGMGBase | ( | const SimulationParameters< dim > & | simulation_parameters, |
| const DoFHandler< dim > & | dof_handler, | ||
| const DoFHandler< dim > & | dof_handler_fe_q_iso_q1 ) |
Construct a new precondition GMG object. Sets constraints, operators and transfer objects.
| [in] | simulation_parameters | Object containing all parameters specified in input file. |
| [in] | dof_handler | Describes the layout of DoFs and the type of FE. |
| [in] | dof_handler_fe_q_iso_q1 | Describes the layout of DoFs for FE_Q_iso_Q1 elements. |
Definition at line 755 of file fluid_dynamics_matrix_free.cc.
References dof_handler, dof_handler_fe_q_iso_q1, fluid_dynamics, mg_setup_timer, mg_vmult_timer, SimulationParameters< dim >::mortar_parameters, pcout, simulation_parameters, and use_manifold_for_normal.
|
virtualdefault |
Default destructor.
|
pure virtual |
Creates the operator for a given level.
| [in] | level | Identifier of the level to be created |
Implemented in MFNavierStokesPreconditionGMG< dim >, and MFNavierStokesVANSPreconditionGMG< dim >.
| const MGLevelObject< std::shared_ptr< NavierStokesOperatorBase< dim, typename MFNavierStokesPreconditionGMGBase< dim >::MGNumber > > > & MFNavierStokesPreconditionGMGBase< dim >::get_mg_operators | ( | ) | const |
Getter function for all level operators.
Definition at line 2456 of file fluid_dynamics_matrix_free.cc.
References mg_operators.
| const MGLevelObject< std::shared_ptr< PreconditionBase< typename MFNavierStokesPreconditionGMGBase< dim >::MGVectorType > > > & MFNavierStokesPreconditionGMGBase< dim >::get_mg_smoother_preconditioners | ( | ) | const |
Getter function for all level smoother preconditioners.
Definition at line 2464 of file fluid_dynamics_matrix_free.cc.
References mg_smoother_preconditioners.
| void MFNavierStokesPreconditionGMGBase< dim >::initialize | ( | ) |
Initialize smoother, coarse grid solver and multigrid object needed for the geometric multigrid preconditioner.
Definition at line 1877 of file fluid_dynamics_matrix_free.cc.
References Parameters::LinearSolver::amg, Parameters::LinearSolver::chebyshev, coarse_grid_precondition, coarse_grid_solver, coarse_grid_solver_control, coarse_grid_solver_control_intermediate, coarse_grid_solver_intermediate, Parameters::LinearSolver::direct, direct_solver_control, dof_handler, fluid_dynamics, gc_multigrid_preconditioner, gc_multigrid_preconditioner_intermediate, Parameters::LinearSolver::gcmg, Parameters::LinearSolver::gmres, Parameters::LinearSolver::ilu, PreconditionASM< VectorType >::initialize(), intlevel, ls_mg_interface_in, ls_multigrid_preconditioner, ls_multigrid_preconditioner_intermediate, Parameters::LinearSolver::lsmg, maxlevel, mg, mg_coarse, mg_coarse_intermediate, mg_interface_matrix_in, mg_intermediate, mg_matrix, mg_operators, mg_setup_timer, mg_smoother, mg_smoother_preconditioners, mg_transfer_gc, mg_transfer_ls, mg_vmult_timer, minlevel, pcout, Parameters::quiet, setup_AMG(), setup_ILU(), and simulation_parameters.
| void MFNavierStokesPreconditionGMGBase< dim >::print_relevant_info | ( | ) | const |
Prints relevant multigrid information.
Definition at line 2428 of file fluid_dynamics_matrix_free.cc.
References coarse_grid_iterations, coarse_grid_solver_control, coarse_grid_solver_control_intermediate, and pcout.
| void MFNavierStokesPreconditionGMGBase< dim >::reinit | ( | const std::shared_ptr< Mapping< dim > > & | mapping, |
| const std::shared_ptr< Quadrature< dim > > & | cell_quadrature, | ||
| const std::shared_ptr< Function< dim > > & | forcing_function, | ||
| const std::shared_ptr< SimulationControl > & | simulation_control, | ||
| const std::shared_ptr< PhysicalPropertiesManager > & | physical_properties_manager, | ||
| const std::shared_ptr< FESystem< dim > > & | fe ) |
Initializes geometric multigrid preconditioner and pre-calculate terms that are constant.
| [in] | mapping | Describes the transformations from unit to real cell. |
| [in] | cell_quadrature | Required for local operations on cells. |
| [in] | forcing_function | Function specified in parameter file as source term. |
| [in] | simulation_control | Required to get the time stepping method. |
| [in] | physical_properties_manager | Required to have the updated values of physical properties in case of ramp or viscous initial conditions. |
| [in] | fe | Describes the FE system for the vector-valued problem. |
Definition at line 787 of file fluid_dynamics_matrix_free.cc.
References Parameters::Mortar< dim >::circular, coarse_grid_triangulations, create_level_operator(), dof_handler, dof_handler_fe_q_iso_q1, dof_handlers, establish_solid_domain(), establish_solid_domain_lsmg(), Parameters::extra_verbose, fluid_dynamics, BoundaryConditions::function, BoundaryConditions::function_weak, Parameters::LinearSolver::gcmg, Parameters::LinearSolver::h, Parameters::LinearSolver::hp, intlevel, Parameters::Mortar< dim >::linear, ls_mg_interface_in, ls_mg_operators, Parameters::LinearSolver::lsmg, mappings, maxlevel, mg_constrained_dofs, mg_operators, mg_setup_timer, mg_transfer_gc, mg_transfer_ls, minlevel, BoundaryConditions::none, BoundaryConditions::noslip, BoundaryConditions::outlet, Parameters::LinearSolver::p, BoundaryConditions::partial_slip, pcout, BoundaryConditions::periodic, Parameters::LinearSolver::ph, BoundaryConditions::pressure, pressure, Parameters::quiet, reinit(), LetheGridTools::rotate_mapping(), simulation_parameters, BoundaryConditions::slip, transfers, and use_manifold_for_normal.
|
protected |
Set up AMG object needed for coarse-grid solver or preconditioning.
Definition at line 2471 of file fluid_dynamics_matrix_free.cc.
References coarse_grid_precondition, dof_handler, dof_handlers, fluid_dynamics, Parameters::LinearSolver::gcmg, Parameters::LinearSolver::lsmg, mg_operators, minlevel, and simulation_parameters.
|
protected |
Set up ILU object needed for coarse-grid solver or preconditioning.
Definition at line 2580 of file fluid_dynamics_matrix_free.cc.
References coarse_grid_precondition, fluid_dynamics, mg_operators, minlevel, and simulation_parameters.
| void MFNavierStokesPreconditionGMGBase< dim >::vmult | ( | VectorType & | dst, |
| const VectorType & | src ) const |
Calls the v cycle function of the multigrid object.
| [in,out] | dst | Destination vector holding the result. |
| [in] | src | Input source vector. |
Definition at line 2407 of file fluid_dynamics_matrix_free.cc.
References coarse_grid_iterations, coarse_grid_solver_control, coarse_grid_solver_control_intermediate, gc_multigrid_preconditioner, and ls_multigrid_preconditioner.
|
mutableprotected |
Vector holding number of coarse grid iterations.
Definition at line 306 of file fluid_dynamics_matrix_free.h.
|
protected |
Coarse grid solver (algebraic multigrid, ILU, direct solver).
Definition at line 248 of file fluid_dynamics_matrix_free.h.
|
protected |
GMRES as coarse grid solver.
Definition at line 257 of file fluid_dynamics_matrix_free.h.
|
protected |
Solver control for the coarse grid solver.
Definition at line 251 of file fluid_dynamics_matrix_free.h.
|
protected |
Solver control for the coarse grid solver (intermediate level).
Definition at line 263 of file fluid_dynamics_matrix_free.h.
|
protected |
GMRES as coarse grid solver (intermediate level).
Definition at line 269 of file fluid_dynamics_matrix_free.h.
|
protected |
Triangulations for the global coarsening case.
Definition at line 203 of file fluid_dynamics_matrix_free.h.
|
protected |
Solver control for the direct solver.
Definition at line 254 of file fluid_dynamics_matrix_free.h.
|
protected |
Describes the layout of DoFs and the type of FE.
Definition at line 300 of file fluid_dynamics_matrix_free.h.
|
protected |
Describes the layout of DoFs for FE_Q_iso_Q1 elements.
Definition at line 303 of file fluid_dynamics_matrix_free.h.
|
protected |
DoF handlers for each of the levels of the global coarsening algorithm.
Definition at line 206 of file fluid_dynamics_matrix_free.h.
|
protected |
Global coarsening multigrid preconditioner object.
Definition at line 291 of file fluid_dynamics_matrix_free.h.
|
protected |
Global coarsening multigrid preconditioner object (intermediate level).
Definition at line 276 of file fluid_dynamics_matrix_free.h.
|
protected |
Intermediate level of the multigrid hierarchy.
Definition at line 199 of file fluid_dynamics_matrix_free.h.
|
protected |
Definition at line 225 of file fluid_dynamics_matrix_free.h.
|
protected |
Definition at line 223 of file fluid_dynamics_matrix_free.h.
|
protected |
Local smoothing multigrid preconditioner object.
Definition at line 287 of file fluid_dynamics_matrix_free.h.
|
protected |
Local smoothing multigrid preconditioner object (intermediate level).
Definition at line 280 of file fluid_dynamics_matrix_free.h.
|
protected |
MappingQCache for each of the levels of the global coarsening algorithm.
Definition at line 209 of file fluid_dynamics_matrix_free.h.
|
protected |
Max level of the multigrid hierarchy.
Definition at line 196 of file fluid_dynamics_matrix_free.h.
|
protected |
Multigrid method.
Definition at line 283 of file fluid_dynamics_matrix_free.h.
|
protected |
Multigrid wrapper for the coarse grid solver.
Definition at line 260 of file fluid_dynamics_matrix_free.h.
|
protected |
Multigrid wrapper for the coarse grid solver (intermediate level).
Definition at line 266 of file fluid_dynamics_matrix_free.h.
|
protected |
Collection of boundary constraints and refinement edge constrations for the different levels in the local smoothing approach.
Definition at line 238 of file fluid_dynamics_matrix_free.h.
|
protected |
Interface edge matrix needed only for local smoothing.
Definition at line 221 of file fluid_dynamics_matrix_free.h.
|
protected |
Multigrid method (intermediate level).
Definition at line 272 of file fluid_dynamics_matrix_free.h.
|
protected |
Multigrid level object storing all operators.
Definition at line 218 of file fluid_dynamics_matrix_free.h.
|
protected |
Level operators for the geometric multigrid.
Definition at line 215 of file fluid_dynamics_matrix_free.h.
|
mutable |
Timer for specific geometric multigrid components.
Definition at line 325 of file fluid_dynamics_matrix_free.h.
|
protected |
Smoother object. Stored through the type-erased base so that either a relaxation-based (PreconditionRelaxation) or a Chebyshev-based (PreconditionChebyshev) smoother can be selected at runtime.
Definition at line 234 of file fluid_dynamics_matrix_free.h.
|
mutableprotected |
Preconditioners associated to smoothers.
Definition at line 229 of file fluid_dynamics_matrix_free.h.
|
protected |
Transfer operator for global coarsening.
Definition at line 244 of file fluid_dynamics_matrix_free.h.
|
protected |
Transfer operator for global coarsening for the temperature.
Definition at line 317 of file fluid_dynamics_matrix_free.h.
|
protected |
Transfer operator for local smoothing.
Definition at line 241 of file fluid_dynamics_matrix_free.h.
|
mutable |
Internal timer for vmult timings.
Definition at line 328 of file fluid_dynamics_matrix_free.h.
|
protected |
Min level of the multigrid hierarchy.
Definition at line 193 of file fluid_dynamics_matrix_free.h.
|
protected |
Conditional Ostream.
Definition at line 294 of file fluid_dynamics_matrix_free.h.
|
protected |
Simulation parameters.
Definition at line 297 of file fluid_dynamics_matrix_free.h.
|
protected |
Temperature DoF handlers for each of the levels of the global coarsening algorithm
Definition at line 310 of file fluid_dynamics_matrix_free.h.
|
protected |
Transfers for each of the levels of the global coarsening algorithm.
Definition at line 212 of file fluid_dynamics_matrix_free.h.
|
protected |
Temperature transfers for each of the levels of the global coarsening algorithm
Definition at line 314 of file fluid_dynamics_matrix_free.h.
|
protected |
Boolean that indicates whether manifolds are used for the normal vectors computation in slip BCs
Definition at line 321 of file fluid_dynamics_matrix_free.h.