From 89f21675b1b5e79d179b998513ed37eb11b48dba Mon Sep 17 00:00:00 2001 From: allmaras Date: Tue, 4 Oct 2011 23:03:50 +0000 Subject: [PATCH] small clarification in workstream description in multithreading module git-svn-id: https://svn.dealii.org/trunk@24533 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/doxygen/headers/multithreading.h | 26 ++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/deal.II/doc/doxygen/headers/multithreading.h b/deal.II/doc/doxygen/headers/multithreading.h index 11c70f3632..194308e9e1 100644 --- a/deal.II/doc/doxygen/headers/multithreading.h +++ b/deal.II/doc/doxygen/headers/multithreading.h @@ -916,6 +916,13 @@ : fe_values (fe, quadrature, update_flags) {} + + ScratchData (const ScratchData &scratch) + : + fe_values (scratch.fe_values.get_fe(), + scratch.fe_values.get_quadrature(), + scratch.fe_values.get_update_flags()) + {} } * @endcode * and then use this FEValues object in the assemble function: @@ -929,8 +936,15 @@ ... } * @endcode + * Just as for the PerTaskData structure, we will create a + * sample ScratchData object and pass it to the work stream + * object, which will replicate it as many times as necessary. For this + * to work ScratchData structures need to copyable. Since FEValues + * objects are rather complex and cannot be copied implicitly, we provided + * our own copy constructor for the ScratchData structure. + * * The same approach, putting things into the ScratchData - * data structure should be used for everything that is expensive to + * data structure, should be used for everything that is expensive to * construct. This holds, in particular, for everything that needs to * allocate memory upon construction; for example, if the values of a * function need to be evaluated at quadrature points, then this is @@ -957,9 +971,17 @@ const Quadrature &quadrature, const UpdateFlags update_flags) : - rhs_values (quadrature.n_quadrature_points), + rhs_values (quadrature.size()), fe_values (fe, quadrature, update_flags) {} + + ScratchData (const ScratchData &scratch) + : + rhs_values (scratch.rhs_values), + fe_values (scratch.fe_values.get_fe(), + scratch.fe_values.get_quadrature(), + scratch.fe_values.get_update_flags()) + {} } template -- 2.39.5