| 1 |
// ------------------------------------------------------------------------ |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: LGPL-2.1-or-later |
| 4 |
// Copyright (C) 1999 - 2025 by the deal.II authors |
| 5 |
// |
| 6 |
// This file is part of the deal.II library. |
| 7 |
// |
| 8 |
// Part of the source code is dual licensed under Apache-2.0 WITH |
| 9 |
// LLVM-exception OR LGPL-2.1-or-later. Detailed license information |
| 10 |
// governing the source code and code contributions can be found in |
| 11 |
// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II. |
| 12 |
// |
| 13 |
// ------------------------------------------------------------------------ |
| 14 |
|
| 15 |
|
| 16 |
#ifndef dealii_mg_base_templates_h |
| 17 |
#define dealii_mg_base_templates_h |
| 18 |
|
| 19 |
#include <deal.II/base/config.h> |
| 20 |
|
| 21 |
#include <deal.II/multigrid/mg_base.h> |
| 22 |
|
| 23 |
DEAL_II_NAMESPACE_OPEN |
| 24 |
|
| 25 |
template <typename VectorType> |
| 26 |
void |
| 27 |
MGSmootherBase<VectorType>::apply(const unsigned int level, |
| 28 |
VectorType &u, |
| 29 |
const VectorType &rhs) const |
| 30 |
{ |
| 31 |
u = typename VectorType::value_type(0.); |
| 32 |
smooth(level, u, rhs); |
| 33 |
} |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
template <typename VectorType> |
| 38 |
void |
| 39 |
MGTransferBase<VectorType>::prolongate_and_add(const unsigned int to_level, |
| 40 |
VectorType &dst, |
| 41 |
const VectorType &src) const |
| 42 |
{ |
| 43 |
VectorType temp; |
| 44 |
temp.reinit(dst, true); |
| 45 |
|
| 46 |
this->prolongate(to_level, temp, src); |
| 47 |
|
| 48 |
dst += temp; |
| 49 |
} |
| 50 |
|
| 51 |
DEAL_II_NAMESPACE_CLOSE |
| 52 |
|
| 53 |
#endif |