]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move functions from .cc to .templates.h 18059/head
authorPeter Munch <peterrmuench@gmail.com>
Thu, 30 Jan 2025 07:29:45 +0000 (08:29 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Thu, 30 Jan 2025 07:29:45 +0000 (08:29 +0100)
include/deal.II/multigrid/mg_base.templates.h [new file with mode: 0644]
source/multigrid/mg_base.cc

diff --git a/include/deal.II/multigrid/mg_base.templates.h b/include/deal.II/multigrid/mg_base.templates.h
new file mode 100644 (file)
index 0000000..b6b89b6
--- /dev/null
@@ -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 <deal.II/base/config.h>
+
+#include <deal.II/multigrid/mg_base.h>
+
+DEAL_II_NAMESPACE_OPEN
+
+template <typename VectorType>
+void
+MGSmootherBase<VectorType>::apply(const unsigned int level,
+                                  VectorType        &u,
+                                  const VectorType  &rhs) const
+{
+  u = typename VectorType::value_type(0.);
+  smooth(level, u, rhs);
+}
+
+
+
+template <typename VectorType>
+void
+MGTransferBase<VectorType>::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
index faafc1b6be8be9d3fc7851be5b37823359965ff4..caaa6555078682b3092a6786440ed2a5a7f35735 100644 (file)
 #include <deal.II/lac/trilinos_vector.h>
 #include <deal.II/lac/vector.h>
 
-#include <deal.II/multigrid/mg_base.h>
+#include <deal.II/multigrid/mg_base.templates.h>
 
 
 DEAL_II_NAMESPACE_OPEN
 
-
-template <typename VectorType>
-void
-MGSmootherBase<VectorType>::apply(const unsigned int level,
-                                  VectorType        &u,
-                                  const VectorType  &rhs) const
-{
-  u = typename VectorType::value_type(0.);
-  smooth(level, u, rhs);
-}
-
-
-
-template <typename VectorType>
-void
-MGTransferBase<VectorType>::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"

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.