From f586869796f446761e5329196ad0b471c6cfc32e Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 8 Jul 2013 04:05:23 +0000 Subject: [PATCH] Yet another, further reduced version. git-svn-id: https://svn.dealii.org/trunk@29949 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/base/work_stream_03.cc | 71 ++++++++++++++---------------------- 1 file changed, 27 insertions(+), 44 deletions(-) diff --git a/tests/base/work_stream_03.cc b/tests/base/work_stream_03.cc index f912c0fc46..e9f324ea0b 100644 --- a/tests/base/work_stream_03.cc +++ b/tests/base/work_stream_03.cc @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include #include #include @@ -46,6 +48,7 @@ #include #include #include +#include #include #include @@ -57,11 +60,6 @@ template class F : public Function { public: - F () - : - q(1) - {} - virtual double value (const Point &p, const unsigned int component) const { @@ -69,45 +67,42 @@ class F : public Function ExcInternalError()); double val = 0; for (unsigned int d=0; d -void do_project (const Triangulation &triangulation, - const FiniteElement &fe) +void do_project (const FiniteElement &fe) { + Triangulation triangulation; + GridGenerator::hyper_cube (triangulation); + triangulation.refine_global (3); + DoFHandler dof_handler(triangulation); dof_handler.distribute_dofs (fe); ConstraintMatrix constraints; - DoFTools::make_hanging_node_constraints (dof_handler, - constraints); constraints.close (); - Vector projection (dof_handler.n_dofs()); - - // project the function - VectorTools::project (dof_handler, - constraints, - QGauss(3), - F (), - projection); - // just to make sure it doesn't get - // forgotten: handle hanging node - // constraints - constraints.distribute (projection); - - double sum=0; - for (unsigned int i=0; i mass_matrix (sparsity); + Vector tmp (mass_matrix.n()); + + const Function* dummy = 0; + MatrixCreator::create_mass_matrix (dof_handler, QGauss(3), + mass_matrix, F(), tmp, + dummy, constraints); + + double sum=0; + for (unsigned int i=0; i &triangulation, template void test_no_hanging_nodes (const FiniteElement &fe) { - Triangulation triangulation; - GridGenerator::hyper_cube (triangulation); - triangulation.refine_global (3); - for (unsigned int i=0; i<12; ++i) - do_project (triangulation, fe); -} - - - -template -void test () -{ - test_no_hanging_nodes (FE_Q(1)); + do_project (fe); } @@ -145,5 +128,5 @@ int main () deallog.depth_console(0); deallog.threshold_double(1.e-10); - test<3>(); + test_no_hanging_nodes (FE_Q<3>(1)); } -- 2.39.5