ASPECT
stokes_matrix_free_global_coarsening.h
Go to the documentation of this file.
1 // ------------------------------------------------------
2 //
3 // SPDX-License-Identifier: GPL-2.0-or-later
4 //
5 // SPDX-FileCopyrightText: Copyright (C) 2011-2026 by the ASPECT authors.
6 //
7 // This file is part of ASPECT.
8 //
9 // Detailed license information governing the source code and
10 // contributions can be found in the folder LICENSES and in
11 // LICENSE and CONTRIBUTING.md at the top level directory.
12 //
13 // ------------------------------------------------------
14 
15 #ifndef _aspect_simulator_solver_stokes_matrix_free_global_coarsening_h
16 #define _aspect_simulator_solver_stokes_matrix_free_global_coarsening_h
17 
18 #include <aspect/global.h>
21 
25 
29 #include <deal.II/multigrid/mg_transfer_global_coarsening.templates.h>
34 
35 namespace aspect
36 {
47  template <int dim, int velocity_degree>
49  {
50  public:
57  const Parameters<dim> &parameters);
58 
63 
67  void initialize() override;
68 
72  std::string name() const override;
73 
97  solve(const LinearAlgebra::BlockSparseMatrix &system_matrix,
98  const LinearAlgebra::BlockVector &system_rhs,
99  const bool solve_newton_system,
100  const double last_pressure_normalization_adjustment,
101  LinearAlgebra::BlockVector &solution_vector) override;
102 
107  void setup_dofs() override;
108 
112  void setup_multigrid_hierarchy() override;
113 
117  const std::vector<std::shared_ptr<const Triangulation<dim, dim>>> &
118  get_multigrid_triangulations() const override;
119 
128  void assemble(LinearAlgebra::BlockVector &system_rhs) override;
129 
134  void build_preconditioner() override;
135 
139  static
141 
145  void parse_parameters (ParameterHandler &prm) override;
146 
150  std::size_t get_dof_handler_memory_consumption() const override;
151 
155  std::size_t get_mg_transfer_memory_consumption() const override;
156 
160  std::size_t get_constraint_memory_consumption() const override;
161 
166  std::size_t get_cell_data_memory_consumption() const override;
167 
168  private:
175 
181 
186 
192 
198 
202 
207 
212 
219 
224 
227 
231 
232  unsigned int min_level;
233  unsigned int max_level;
234 
235  std::vector<std::shared_ptr<MatrixFree<dim,double>>> matrix_free_objects;
236 
237  std::vector<std::shared_ptr<const Triangulation<dim, dim>>> trias;
238 
249  const Mapping<dim> &get_level_triangulation_mapping(const unsigned int level);
250 
255  std::unique_ptr<Mapping<dim>> level_triangulation_mapping;
256 
260 
263 
266  std::unique_ptr<GCMGTransferType<dim,GMGNumberType>> mg_transfer_A_block;
267  std::unique_ptr<GCMGTransferType<dim,GMGNumberType>> mg_transfer_Schur_complement;
268  };
269 }
270 
271 #endif
void parse_parameters(ParameterHandler &prm) override
std::vector< std::shared_ptr< const Triangulation< dim, dim > > > trias
std::unique_ptr< GCMGTransferType< dim, GMGNumberType > > mg_transfer_Schur_complement
const std::vector< std::shared_ptr< const Triangulation< dim, dim > > > & get_multigrid_triangulations() const override
MGLevelObject< MatrixFreeStokesOperators::OperatorCellData< dim, GMGNumberType > > level_cell_data
StokesSolver::SolverOutputs solve(const LinearAlgebra::BlockSparseMatrix &system_matrix, const LinearAlgebra::BlockVector &system_rhs, const bool solve_newton_system, const double last_pressure_normalization_adjustment, LinearAlgebra::BlockVector &solution_vector) override
MGLevelObject< MGTwoLevelTransfer< dim, ::LinearAlgebra::distributed::Vector< GMGNumberType > > > transfers_p
void assemble(LinearAlgebra::BlockVector &system_rhs) override
MatrixFreeStokesOperators::OperatorCellData< dim, GMGNumberType > active_cell_data
const Mapping< dim > & get_level_triangulation_mapping(const unsigned int level)
void correct_stokes_rhs(LinearAlgebra::BlockVector &system_rhs)
std::unique_ptr< GCMGTransferType< dim, GMGNumberType > > mg_transfer_A_block
MGLevelObject< MGTwoLevelTransfer< dim, ::LinearAlgebra::distributed::Vector< GMGNumberType > > > transfers_v
std::vector< std::shared_ptr< MatrixFree< dim, double > > > matrix_free_objects
StokesMatrixFreeHandlerGlobalCoarseningImplementation(Simulator< dim > &simulator, const Parameters< dim > &parameters)
ObserverPointer< const Simulator< dim >, SimulatorAccess< dim > > simulator