ASPECT
stokes_matrix_free_local_smoothing.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_local_smoothing_h
16 #define _aspect_simulator_solver_stokes_matrix_free_local_smoothing_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>
48  class StokesMatrixFreeHandlerLocalSmoothingImplementation: public StokesMatrixFreeHandler<dim>
49  {
50  public:
57  const Parameters<dim> &parameters);
58 
63 
67  void initialize() override;
68 
72  std::string name() const override;
73 
96  StokesSolver::SolverOutputs
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  const std::vector<std::shared_ptr<const Triangulation<dim, dim>>> &
113  get_multigrid_triangulations() const override;
114 
123  void assemble(LinearAlgebra::BlockVector &system_rhs) override;
124 
129  void build_preconditioner() override;
130 
134  static
136 
140  void parse_parameters (ParameterHandler &prm) override;
141 
145  std::size_t get_dof_handler_memory_consumption() const override;
146 
150  std::size_t get_mg_transfer_memory_consumption() const override;
151 
155  std::size_t get_constraint_memory_consumption() const override;
156 
161  std::size_t get_cell_data_memory_consumption() const override;
162 
167  {
168  return dof_handler_v;
169  }
170 
175  {
177  }
178 
183  {
184  return mg_transfer_A_block;
185  }
186 
187  private:
194 
200 
201 
203 
205 
211 
217 
221 
225 
230 
235 
242 
247 
250 
253 
257 
260 
261  std::vector<std::shared_ptr<MatrixFree<dim,double>>> matrix_free_objects;
262  };
263 }
264 
265 #endif
::TrilinosWrappers::MPI::BlockVector BlockVector
Definition: global.h:295
MGLevelObject< GMGSchurComplementMatrixType > mg_matrices_Schur_complement
MatrixFreeStokesOperators::OperatorCellData< dim, GMGNumberType > active_cell_data
const std::vector< std::shared_ptr< const Triangulation< dim, dim > > > & get_multigrid_triangulations() const override
::TrilinosWrappers::BlockSparseMatrix BlockSparseMatrix
Definition: global.h:306
void parse_parameters(ParameterHandler &prm) override
const MGTransferType< dim, GMGNumberType > & get_velocity_multigrid_transfer() const
void correct_stokes_rhs(LinearAlgebra::BlockVector &system_rhs)
void assemble(LinearAlgebra::BlockVector &system_rhs) override
std::vector< std::shared_ptr< MatrixFree< dim, double > > > matrix_free_objects
static void declare_parameters(ParameterHandler &prm)
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
StokesMatrixFreeHandlerLocalSmoothingImplementation(Simulator< dim > &simulator, const Parameters< dim > &parameters)
MGLevelObject< MatrixFreeStokesOperators::OperatorCellData< dim, GMGNumberType > > level_cell_data
ObserverPointer< const Simulator< dim >, SimulatorAccess< dim > > simulator