From e83e5527812c09d6021f5f196e4ef97f926574fb Mon Sep 17 00:00:00 2001 From: David Wells Date: Sat, 21 Jan 2017 19:49:53 -0500 Subject: [PATCH] Give the hp version of VectorTools::project its own file. 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 | 2 + source/numerics/vector_tools_project.inst.in | 23 ---------- source/numerics/vector_tools_project_hp.cc | 25 ++++++++++ .../numerics/vector_tools_project_hp.inst.in | 46 +++++++++++++++++++ 4 files changed, 73 insertions(+), 23 deletions(-) create mode 100644 source/numerics/vector_tools_project_hp.cc create mode 100644 source/numerics/vector_tools_project_hp.inst.in diff --git a/source/numerics/CMakeLists.txt b/source/numerics/CMakeLists.txt index b1df672972..5b6fbfac48 100644 --- a/source/numerics/CMakeLists.txt +++ b/source/numerics/CMakeLists.txt @@ -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 diff --git a/source/numerics/vector_tools_project.inst.in b/source/numerics/vector_tools_project.inst.in index b9c8f827f8..b9fbf8f962 100644 --- a/source/numerics/vector_tools_project.inst.in +++ b/source/numerics/vector_tools_project.inst.in @@ -41,29 +41,6 @@ for (VEC : REAL_SERIAL_VECTORS ; deal_II_dimension : DIMENSIONS; deal_II_space_d const bool, const Quadrature &, const bool); - - template - void project - (const hp::MappingCollection &, - const hp::DoFHandler &, - const ConstraintMatrix &, - const hp::QCollection &, - const Function &, - VEC &, - const bool, - const hp::QCollection &, - const bool); - - template - void project - (const hp::DoFHandler &, - const ConstraintMatrix &, - const hp::QCollection &, - const Function &, - VEC &, - const bool, - const hp::QCollection &, - 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 index 0000000000..0a30d20db9 --- /dev/null +++ b/source/numerics/vector_tools_project_hp.cc @@ -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_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 index 0000000000..b4a093efcf --- /dev/null +++ b/source/numerics/vector_tools_project_hp.inst.in @@ -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 &, + const hp::DoFHandler &, + const ConstraintMatrix &, + const hp::QCollection &, + const Function &, + VEC &, + const bool, + const hp::QCollection &, + const bool); + + template + void project + (const hp::DoFHandler &, + const ConstraintMatrix &, + const hp::QCollection &, + const Function &, + VEC &, + const bool, + const hp::QCollection &, + const bool); + \} +#endif +} -- 2.39.5