From: bangerth Date: Thu, 20 Sep 2012 14:03:34 +0000 (+0000) Subject: New test. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=301fdf5f89a76fd153f7aad9e70abdebe7ffdf14;p=dealii-svn.git New test. git-svn-id: https://svn.dealii.org/trunk@26567 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/hp/fe_collection_04.cc b/tests/hp/fe_collection_04.cc new file mode 100644 index 0000000000..77bdf0abb0 --- /dev/null +++ b/tests/hp/fe_collection_04.cc @@ -0,0 +1,73 @@ +//---------------------------- fe_collection_04.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2005, 2006, 2012 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. +// +//---------------------------- fe_collection_04.cc --------------------------- + + +// test the results of FECollection::n_blocks(). test the case where elements +// have the same number of components but different numbers of blocks. this +// needs to lead to an assertion. + + +#include "../tests.h" +#include +#include +#include +#include +#include + +#include + + +template +void test () +{ + // now the same with one of the elements + // being non-primitive. the other one can + // then not simply be a FESystem but must + // in fact be an FESystem of FESystem to + // hide multiple components in one + // block. this test tries to see what + // happens if one doesn't do this + hp::FECollection fe_collection; + fe_collection.push_back (FE_RaviartThomas(1)); + fe_collection.push_back (FESystem(FE_Q(2),dim)); + + // we will get an assertion failure in + // n_blocks here. what it returns instead + // is then meaningless but it will in fact + // be the number of blocks of the first + // element of the collection, which here is + // one + Assert (fe_collection.n_blocks() == 1, + ExcInternalError()); + + deallog << "OK" << std::endl; +} + + + +int main () +{ + deal_II_exceptions::disable_abort_on_exception(); + + std::ofstream logfile("fe_collection_04/output"); + logfile.precision(2); + + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + test<2> (); + test<3> (); + + deallog << "OK" << std::endl; +} diff --git a/tests/hp/fe_collection_04/cmp/generic b/tests/hp/fe_collection_04/cmp/generic new file mode 100644 index 0000000000..8c032077cb --- /dev/null +++ b/tests/hp/fe_collection_04/cmp/generic @@ -0,0 +1,6 @@ + +DEAL::ExcMessage ("Not all finite elements in this collection have " "the same number of components.") +DEAL::OK +DEAL::ExcMessage ("Not all finite elements in this collection have " "the same number of components.") +DEAL::OK +DEAL::OK