]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Give the codim > 0 VectorTools::project functions their own file. 3831/head
authorDavid Wells <wellsd2@rpi.edu>
Sun, 22 Jan 2017 05:41:09 +0000 (00:41 -0500)
committerDavid Wells <wellsd2@rpi.edu>
Sun, 22 Jan 2017 15:01:40 +0000 (10:01 -0500)
Since these functions don't go into the MatrixFree code we can split them off
with a very small amount of overhead for the additional parallelization. This
lowers the required memory for the last projection instantiation by about a
gigabyte.

Before:
                                    File name Memory, MB    Time, s
      source/numerics/vector_tools_project.cc       2775         79
source/numerics/vector_tools_project_inst2.cc       2882         92
source/numerics/vector_tools_project_inst3.cc       3948        102

After:
                                    File name Memory, MB    Time, s
source/numerics/vector_tools_project_codim.cc       1843         28
      source/numerics/vector_tools_project.cc       2774         76
source/numerics/vector_tools_project_inst2.cc       2829         81
source/numerics/vector_tools_project_inst3.cc       2823         86

source/numerics/CMakeLists.txt
source/numerics/vector_tools_project.inst.in
source/numerics/vector_tools_project_codim.cc [new file with mode: 0644]
source/numerics/vector_tools_project_codim.inst.in [new file with mode: 0644]

index 5b6fbfac48f1b6ef554adb1e88254bbe1d4b28e2..a770796fd74a7d8c310dc0b304f15cd4733c5c70 100644 (file)
@@ -51,6 +51,7 @@ SET(_src
   vector_tools_project_inst2.cc
   vector_tools_project_inst3.cc
   vector_tools_project_hp.cc
+  vector_tools_project_codim.cc
   vector_tools_project_qp.cc
   vector_tools_project_qpmf.cc
   vector_tools_rhs.cc
@@ -81,6 +82,7 @@ SET(_inst
   vector_tools_point_value.inst.in
   vector_tools_point_gradient.inst.in
   vector_tools_project.inst.in
+  vector_tools_project_codim.inst.in
   vector_tools_project_hp.inst.in
   vector_tools_project_qp.inst.in
   vector_tools_project_qpmf.inst.in
index b9fbf8f962d1d65afc1ec8673aef58fbefe2de76..103b08b00c6d8d24644719fd686f1a4f230efb11 100644 (file)
@@ -16,7 +16,7 @@
 
 for (VEC : REAL_SERIAL_VECTORS ; deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
 {
-#if deal_II_dimension <= deal_II_space_dimension
+#if deal_II_dimension == deal_II_space_dimension
     namespace VectorTools \{
 
     template
diff --git a/source/numerics/vector_tools_project_codim.cc b/source/numerics/vector_tools_project_codim.cc
new file mode 100644 (file)
index 0000000..ae9a28b
--- /dev/null
@@ -0,0 +1,25 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2017 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+#include <deal.II/numerics/vector_tools.templates.h>
+
+DEAL_II_NAMESPACE_OPEN
+
+// ---------------------------- explicit instantiations --------------------
+
+#include "vector_tools_project_codim.inst"
+
+DEAL_II_NAMESPACE_CLOSE
diff --git a/source/numerics/vector_tools_project_codim.inst.in b/source/numerics/vector_tools_project_codim.inst.in
new file mode 100644 (file)
index 0000000..e68a3a0
--- /dev/null
@@ -0,0 +1,46 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2017 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+for (VEC : REAL_SERIAL_VECTORS ; deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
+{
+#if deal_II_dimension < deal_II_space_dimension
+    namespace VectorTools \{
+
+    template
+    void project<deal_II_dimension, VEC, deal_II_space_dimension>
+    (const Mapping<deal_II_dimension,deal_II_space_dimension>      &,
+     const DoFHandler<deal_II_dimension,deal_II_space_dimension>   &,
+     const ConstraintMatrix                &,
+     const Quadrature<deal_II_dimension>   &,
+     const Function<deal_II_space_dimension,VEC::value_type>     &,
+     VEC                                   &,
+     const bool,
+     const Quadrature<deal_II_dimension-1> &,
+     const bool);
+
+    template
+    void project<deal_II_dimension, VEC, deal_II_space_dimension>
+    (const DoFHandler<deal_II_dimension,deal_II_space_dimension>   &,
+     const ConstraintMatrix                &,
+     const Quadrature<deal_II_dimension>   &,
+     const Function<deal_II_space_dimension,VEC::value_type>     &,
+     VEC                                   &,
+     const bool,
+     const Quadrature<deal_II_dimension-1> &,
+     const bool);
+    \}
+#endif
+}

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.