From: bangerth Date: Wed, 17 Dec 2008 11:47:09 +0000 (+0000) Subject: Ensure that FEValuesExtractors objects are copyable. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15963919c3ddbab55521fb2b7259ce2bee14d850;p=dealii-svn.git Ensure that FEValuesExtractors objects are copyable. git-svn-id: https://svn.dealii.org/trunk@17968 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/fe/fe_values.h b/deal.II/deal.II/include/fe/fe_values.h index 61b36bce72..b6584a454c 100644 --- a/deal.II/deal.II/include/fe/fe_values.h +++ b/deal.II/deal.II/include/fe/fe_values.h @@ -81,7 +81,7 @@ namespace FEValuesExtractors * The selected scalar component of the * vector. */ - const unsigned int component; + unsigned int component; /** * Constructor. Take the selected @@ -110,9 +110,10 @@ namespace FEValuesExtractors struct Vector { /** - * The first component of the vector view. + * The first component of the vector + * view. */ - const unsigned int first_vector_component; + unsigned int first_vector_component; /** * Constructor. Take the first diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index b38b0b17e8..4c3b5b0380 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -598,6 +598,14 @@ inconvenience this causes.

deal.II

    +
  1. +

    + Fixed: The FEValuesExtractors classes were not copyable though there + are legitimate reasons to do so. This is now fixed. +
    + (WB 2008/12/17) +

    +
  2. Fixed: The MappingQEulerian function was not thread-safe. This is now fixed. diff --git a/tests/deal.II/Makefile b/tests/deal.II/Makefile index cb009839c5..b5d03e19d5 100644 --- a/tests/deal.II/Makefile +++ b/tests/deal.II/Makefile @@ -77,6 +77,7 @@ tests_x = block_matrices \ line_coarsening_3d \ no_flux_* \ fe_values_view_* \ + fe_values_extractor_* \ rt_hessian \ rt_covariant \ coarsening_* \ diff --git a/tests/deal.II/fe_values_extractor_01.cc b/tests/deal.II/fe_values_extractor_01.cc new file mode 100644 index 0000000000..a6f9e40202 --- /dev/null +++ b/tests/deal.II/fe_values_extractor_01.cc @@ -0,0 +1,45 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2007, 2008 by the deal.II authors +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//---------------------------------------------------------------------- + + +// test that the FEValuesExtractors are copyable + +#include "../tests.h" +#include + +#include + + + + +int main() +{ + std::ofstream logfile ("fe_values_extractor_01/output"); + deallog << std::setprecision (2); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-10); + + { + std::vector x; + x.push_back (FEValuesExtractors::Scalar(42)); + } + + { + std::vector x; + x.push_back (FEValuesExtractors::Vector(42)); + } + + deallog << "OK" << std::endl; +} diff --git a/tests/deal.II/fe_values_extractor_01/cmp/generic b/tests/deal.II/fe_values_extractor_01/cmp/generic new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/deal.II/fe_values_extractor_01/cmp/generic @@ -0,0 +1,2 @@ + +DEAL::OK