From 3fdd4fdcd2363d586b3b6bd896c2ceffeaf9ba2c Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Thu, 30 Jan 2025 08:29:45 +0100 Subject: [PATCH] Move functions from .cc to .templates.h --- include/deal.II/multigrid/mg_base.templates.h | 53 +++++++++++++++++++ source/multigrid/mg_base.cc | 30 +---------- 2 files changed, 54 insertions(+), 29 deletions(-) create mode 100644 include/deal.II/multigrid/mg_base.templates.h diff --git a/include/deal.II/multigrid/mg_base.templates.h b/include/deal.II/multigrid/mg_base.templates.h new file mode 100644 index 0000000000..b6b89b66ae --- /dev/null +++ b/include/deal.II/multigrid/mg_base.templates.h @@ -0,0 +1,53 @@ +// ------------------------------------------------------------------------ +// +// SPDX-License-Identifier: LGPL-2.1-or-later +// Copyright (C) 1999 - 2023 by the deal.II authors +// +// This file is part of the deal.II library. +// +// Part of the source code is dual licensed under Apache-2.0 WITH +// LLVM-exception OR LGPL-2.1-or-later. Detailed license information +// governing the source code and code contributions can be found in +// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II. +// +// ------------------------------------------------------------------------ + + +#ifndef dealii_mg_base_templates_h +#define dealii_mg_base_templates_h + +#include + +#include + +DEAL_II_NAMESPACE_OPEN + +template +void +MGSmootherBase::apply(const unsigned int level, + VectorType &u, + const VectorType &rhs) const +{ + u = typename VectorType::value_type(0.); + smooth(level, u, rhs); +} + + + +template +void +MGTransferBase::prolongate_and_add(const unsigned int to_level, + VectorType &dst, + const VectorType &src) const +{ + VectorType temp; + temp.reinit(dst, true); + + this->prolongate(to_level, temp, src); + + dst += temp; +} + +DEAL_II_NAMESPACE_CLOSE + +#endif diff --git a/source/multigrid/mg_base.cc b/source/multigrid/mg_base.cc index faafc1b6be..caaa655507 100644 --- a/source/multigrid/mg_base.cc +++ b/source/multigrid/mg_base.cc @@ -22,39 +22,11 @@ #include #include -#include +#include DEAL_II_NAMESPACE_OPEN - -template -void -MGSmootherBase::apply(const unsigned int level, - VectorType &u, - const VectorType &rhs) const -{ - u = typename VectorType::value_type(0.); - smooth(level, u, rhs); -} - - - -template -void -MGTransferBase::prolongate_and_add(const unsigned int to_level, - VectorType &dst, - const VectorType &src) const -{ - VectorType temp; - temp.reinit(dst, true); - - this->prolongate(to_level, temp, src); - - dst += temp; -} - - // Explicit instantiations #include "mg_base.inst" -- 2.39.5