ExaDG
Loading...
Searching...
No Matches
transfer.h
1/* ______________________________________________________________________
2 *
3 * ExaDG - High-Order Discontinuous Galerkin for the Exa-Scale
4 *
5 * Copyright (C) 2021 by the ExaDG authors
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 * ______________________________________________________________________
20 */
21
22#ifndef INCLUDE_SOLVERS_AND_PRECONDITIONERS_MULTIGRID_MUTLIGRID_TRANSFER_H_
23#define INCLUDE_SOLVERS_AND_PRECONDITIONERS_MULTIGRID_MUTLIGRID_TRANSFER_H_
24
25// deal.II
26#include <deal.II/fe/mapping.h>
27#include <deal.II/matrix_free/matrix_free.h>
28#include <deal.II/multigrid/mg_constrained_dofs.h>
29#include <deal.II/multigrid/mg_transfer_global_coarsening.h>
30
31// ExaDG
32#include <exadg/solvers_and_preconditioners/multigrid/levels_hybrid_multigrid.h>
33#include <exadg/solvers_and_preconditioners/multigrid/transfer_base.h>
34
35namespace ExaDG
36{
37template<int dim, typename Number, typename VectorType>
38class MultigridTransfer : public MultigridTransferBase<VectorType>
39{
40public:
41 void
42 reinit(dealii::MGLevelObject<std::shared_ptr<dealii::MatrixFree<dim, Number>>> & mg_matrixfree,
43 unsigned int const dof_handler_index,
44 std::vector<MGLevelInfo> const & global_levels);
45
46 void
47 interpolate(unsigned int const level, VectorType & dst, VectorType const & src) const final;
48
49 void
50 restrict_and_add(unsigned int const level, VectorType & dst, VectorType const & src) const final;
51
52 void
53 prolongate_and_add(unsigned int const level,
54 VectorType & dst,
55 VectorType const & src) const final;
56
57private:
58 dealii::MGLevelObject<dealii::MGTwoLevelTransfer<dim, VectorType>> transfers;
59
60 std::unique_ptr<dealii::MGTransferGlobalCoarsening<dim, VectorType>> mg_transfer;
61};
62} // namespace ExaDG
63
64#endif // INCLUDE_SOLVERS_AND_PRECONDITIONERS_MULTIGRID_MUTLIGRID_TRANSFER_H_
Definition transfer_base.h:29
Definition transfer.h:39
Definition driver.cpp:33