ASPECT
stokes_matrix_free_global_coarsening.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2026 by the authors of the ASPECT code.
3 
4  This file is part of ASPECT.
5 
6  ASPECT is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2, or (at your option)
9  any later version.
10 
11  ASPECT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with ASPECT; see the file LICENSE. If not see
18  <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef _aspect_simulator_solver_stokes_matrix_free_global_coarsening_h
22 #define _aspect_simulator_solver_stokes_matrix_free_global_coarsening_h
23 
24 #include <aspect/global.h>
27 
31 
35 #include <deal.II/multigrid/mg_transfer_global_coarsening.templates.h>
40 
41 namespace aspect
42 {
53  template <int dim, int velocity_degree>
55  {
56  public:
63  const Parameters<dim> &parameters);
64 
69 
73  void initialize() override;
74 
78  std::string name() const override;
79 
103  solve(const LinearAlgebra::BlockSparseMatrix &system_matrix,
104  const LinearAlgebra::BlockVector &system_rhs,
105  const bool solve_newton_system,
106  const double last_pressure_normalization_adjustment,
107  LinearAlgebra::BlockVector &solution_vector) override;
108 
113  void setup_dofs() override;
114 
118  void setup_multigrid_hierarchy() override;
119 
123  const std::vector<std::shared_ptr<const Triangulation<dim, dim>>> &
124  get_multigrid_triangulations() const override;
125 
134  void assemble(LinearAlgebra::BlockVector &system_rhs) override;
135 
140  void build_preconditioner() override;
141 
145  static
147 
151  void parse_parameters (ParameterHandler &prm) override;
152 
156  std::size_t get_dof_handler_memory_consumption() const override;
157 
161  std::size_t get_mg_transfer_memory_consumption() const override;
162 
166  std::size_t get_constraint_memory_consumption() const override;
167 
172  std::size_t get_cell_data_memory_consumption() const override;
173 
174  private:
181 
187 
192 
198 
204 
208 
213 
218 
225 
230 
233 
237 
238  unsigned int min_level;
239  unsigned int max_level;
240 
241  std::vector<std::shared_ptr<MatrixFree<dim,double>>> matrix_free_objects;
242 
243  std::vector<std::shared_ptr<const Triangulation<dim, dim>>> trias;
244 
256 
261  std::unique_ptr<Mapping<dim>> level_triangulation_mapping;
262 
266 
269 
272  std::unique_ptr<GCMGTransferType<dim,GMGNumberType>> mg_transfer_A_block;
273  std::unique_ptr<GCMGTransferType<dim,GMGNumberType>> mg_transfer_Schur_complement;
274  };
275 }
276 
277 #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
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