From: bangerth Date: Tue, 9 Jul 2013 14:38:08 +0000 (+0000) Subject: Latest version of the test. Really minimal. Still fails with the WorkStream patches... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42f0da4b629d9d64f2006055c24ae4a0f2c677a9;p=dealii-svn.git Latest version of the test. Really minimal. Still fails with the WorkStream patches I have locally :-( git-svn-id: https://svn.dealii.org/trunk@29956 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/base/work_stream_03.cc b/tests/base/work_stream_03.cc index cea42e56fd..0dfb8655c3 100644 --- a/tests/base/work_stream_03.cc +++ b/tests/base/work_stream_03.cc @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -88,10 +89,19 @@ namespace struct CopyData { - Vector cell_rhs; + std::vector cell_rhs; }; } +void zero_subrange (const unsigned int begin, + const unsigned int end, + std::vector &dst) +{ + for (unsigned int i=begin; i void mass_assembler(const CellIterator &cell, Scratch &data, @@ -99,14 +109,18 @@ template { data.x_fe_values.reinit(cell); + const Point q=data.x_fe_values.quadrature_point(0); + // this appears to be the key: the following line overwrites some of the memory // in which we store the quadrature point location. if the line is moved down, // the comparison in the if() always succeeds... - copy_data.cell_rhs = 0; - if (cell->center().distance (data.x_fe_values.quadrature_point(0)) >= 1e-6 *cell->diameter()) - std::cout << '.' << std::flush; - else - std::cout << '*' << std::flush; + parallel::apply_to_subranges + (0U, copy_data.cell_rhs.size(), + std_cxx1x::bind(&zero_subrange, + std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::ref(copy_data.cell_rhs)), + 1); + + std::cout << (q != data.x_fe_values.quadrature_point(0) ? '.' : '*') << std::flush; copy_data.cell_rhs[0] = value(data.x_fe_values.quadrature_point(0)); } @@ -140,7 +154,7 @@ void do_project () double sum = 0; Scratch assembler_data (dof_handler.get_fe(), q); CopyData copy_data; - copy_data.cell_rhs.reinit (8); + copy_data.cell_rhs.resize (8); dealii::WorkStream::run (dof_handler.begin_active(), dof_handler.end(), &mass_assembler::active_cell_iterator>, @@ -152,6 +166,7 @@ void do_project () 8, 1); printf ("\nCheck: %5.3f\n", sum); + deallog << sum << std::endl; } } diff --git a/tests/base/work_stream_03/cmp/generic b/tests/base/work_stream_03/cmp/generic index 0fd8fc12f0..d1b460b43f 100644 --- a/tests/base/work_stream_03/cmp/generic +++ b/tests/base/work_stream_03/cmp/generic @@ -1,2 +1,13 @@ -DEAL::OK +DEAL::288. +DEAL::288. +DEAL::288. +DEAL::288. +DEAL::288. +DEAL::288. +DEAL::288. +DEAL::288. +DEAL::288. +DEAL::288. +DEAL::288. +DEAL::288.