]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Give the hp version of VectorTools::project its own file. 3829/head
authorDavid Wells <wellsd2@rpi.edu>
Sun, 22 Jan 2017 00:49:53 +0000 (19:49 -0500)
committerDavid Wells <wellsd2@rpi.edu>
Sun, 22 Jan 2017 01:47:56 +0000 (20:47 -0500)
This new file takes about 17 seconds to compile and improves the performance of
the non-hp (i.e., the matrix free) projections a little bit.

before splitting out the hp files:
                                    File name Memory, MB    Time, s
      source/numerics/vector_tools_project.cc       2860         81
source/numerics/vector_tools_project_inst2.cc       2970        100
source/numerics/vector_tools_project_inst3.cc       3956        114

After:
                                    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

These numbers come from setting the C++ compiler as a shell script containing

    /usr/bin/time -v g++ ${1+"$@"}

and then parsing the output.

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

index b1df672972f719e5d0fc8daa69fff8ca34fb76a7..5b6fbfac48f1b6ef554adb1e88254bbe1d4b28e2 100644 (file)
@@ -50,6 +50,7 @@ SET(_src
   vector_tools_project.cc
   vector_tools_project_inst2.cc
   vector_tools_project_inst3.cc
+  vector_tools_project_hp.cc
   vector_tools_project_qp.cc
   vector_tools_project_qpmf.cc
   vector_tools_rhs.cc
@@ -80,6 +81,7 @@ SET(_inst
   vector_tools_point_value.inst.in
   vector_tools_point_gradient.inst.in
   vector_tools_project.inst.in
+  vector_tools_project_hp.inst.in
   vector_tools_project_qp.inst.in
   vector_tools_project_qpmf.inst.in
   vector_tools_rhs.inst.in
index b9c8f827f844e35f280f45ca41f1f046fbbe2e95..b9fbf8f962d1d65afc1ec8673aef58fbefe2de76 100644 (file)
@@ -41,29 +41,6 @@ for (VEC : REAL_SERIAL_VECTORS ; deal_II_dimension : DIMENSIONS; deal_II_space_d
      const bool,
      const Quadrature<deal_II_dimension-1> &,
      const bool);
-
-    template
-    void project
-    (const hp::MappingCollection<deal_II_dimension,deal_II_space_dimension>      &,
-     const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension>   &,
-     const ConstraintMatrix                &,
-     const hp::QCollection<deal_II_dimension>   &,
-     const Function<deal_II_space_dimension,VEC::value_type>     &,
-     VEC                                   &,
-     const bool,
-     const hp::QCollection<deal_II_dimension-1> &,
-     const bool);
-
-    template
-    void project
-    (const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension>   &,
-     const ConstraintMatrix                &,
-     const hp::QCollection<deal_II_dimension>   &,
-     const Function<deal_II_space_dimension,VEC::value_type>     &,
-     VEC                                   &,
-     const bool,
-     const hp::QCollection<deal_II_dimension-1> &,
-     const bool);
     \}
 #endif
 }
diff --git a/source/numerics/vector_tools_project_hp.cc b/source/numerics/vector_tools_project_hp.cc
new file mode 100644 (file)
index 0000000..0a30d20
--- /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_hp.inst"
+
+DEAL_II_NAMESPACE_CLOSE
diff --git a/source/numerics/vector_tools_project_hp.inst.in b/source/numerics/vector_tools_project_hp.inst.in
new file mode 100644 (file)
index 0000000..b4a093e
--- /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
+    (const hp::MappingCollection<deal_II_dimension,deal_II_space_dimension>      &,
+     const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension>   &,
+     const ConstraintMatrix                &,
+     const hp::QCollection<deal_II_dimension>   &,
+     const Function<deal_II_space_dimension,VEC::value_type>     &,
+     VEC                                   &,
+     const bool,
+     const hp::QCollection<deal_II_dimension-1> &,
+     const bool);
+
+    template
+    void project
+    (const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension>   &,
+     const ConstraintMatrix                &,
+     const hp::QCollection<deal_II_dimension>   &,
+     const Function<deal_II_space_dimension,VEC::value_type>     &,
+     VEC                                   &,
+     const bool,
+     const hp::QCollection<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.