From: Guido Kanschat Date: Sun, 13 Sep 2009 19:56:31 +0000 (+0000) Subject: new NamedData and NamedSelection classes X-Git-Tag: v8.0.0~7120 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e209e8cba5255cbe88ab77e707eefce995d49b5;p=dealii.git new NamedData and NamedSelection classes git-svn-id: https://svn.dealii.org/trunk@19453 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/base/Makefile b/tests/base/Makefile index ce67d3a7fa..932f13da0c 100644 --- a/tests/base/Makefile +++ b/tests/base/Makefile @@ -66,6 +66,7 @@ tests_x = geometry_info_* \ reference \ quadrature_* qprojector \ path_search \ + named_data \ slice_vector \ table \ tensor \ diff --git a/tests/base/bdm.cc b/tests/base/bdm.cc index a7d7864359..35169a88d8 100644 --- a/tests/base/bdm.cc +++ b/tests/base/bdm.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2000, 2001, 2002, 2003, 2004 by the deal.II authors +// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2009 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -13,7 +13,6 @@ #include "../tests.h" #include -#include #include #include diff --git a/tests/base/named_data.cc b/tests/base/named_data.cc new file mode 100644 index 0000000000..5a71a3656c --- /dev/null +++ b/tests/base/named_data.cc @@ -0,0 +1,85 @@ +//----------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2009 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. +// +//----------------------------------------------------------------------------- + + +#include "../tests.h" +#include +#include + +#include +#include + +template +void +test_const(const NamedData& data) +{ + NamedData newdata; + newdata.merge(data); + data.print(deallog); + + deallog << "Const should be true: " << (newdata.is_const() ? "true" : "false") << std::endl; +} + +template +void +test_selector(const NamedData& data) +{ + NamedSelection select; + select.add("P1"); + select.add("P6"); + select.add("P5"); + select.add("P3"); + select.initialize(data); + + for (unsigned int i=0;i > data; + deallog << "const" << data.is_const() << std::endl; + boost::shared_ptr p = boost::shared_ptr(new double); + data.add(p, "P1"); + p = boost::shared_ptr(new double); + data.add(p, "P2"); + p = boost::shared_ptr(new double); + data.add(p, "P3"); + p = boost::shared_ptr(new double); + data.add(p, "P4"); + p = boost::shared_ptr(new double); + data.add(p, "P5"); + + for (unsigned int i=0;i q21(1); FE_Q<2> q22(2);