From: Wolfgang Bangerth Date: Fri, 18 Feb 2011 17:32:15 +0000 (+0000) Subject: New test. X-Git-Tag: v8.0.0~4306 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5df196562311fb2cffb67791a368cc3e29a8df4;p=dealii.git New test. git-svn-id: https://svn.dealii.org/trunk@23396 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/hp/fe_nothing_08.cc b/tests/hp/fe_nothing_08.cc new file mode 100644 index 0000000000..12d87dd39e --- /dev/null +++ b/tests/hp/fe_nothing_08.cc @@ -0,0 +1,94 @@ +//---------------------------- fe_nothing_08.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009, 2011 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_nothing_08.cc --------------------------- + + +// test that FE_Nothing can be called with interpolate_boundary_values +// with scalar elements + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include + + +template +void test () +{ + Triangulation triangulation; + GridGenerator :: hyper_cube (triangulation, -1, 1); + triangulation.refine_global(1); + + hp::FECollection fe_collection; + fe_collection.push_back (FE_Q(1)); + fe_collection.push_back (FE_Nothing()); + + hp::DoFHandler dof_handler (triangulation); + + typename hp::DoFHandler::active_cell_iterator + cell = dof_handler.begin_active(), + endc = dof_handler.end(); + + for(; cell != endc; cell++) + if (cell->center()[0] > 0) + cell->set_active_fe_index(1); + else + cell->set_active_fe_index(0); + + dof_handler.distribute_dofs (fe_collection); + deallog << dof_handler.n_dofs() << " dofs" << std::endl; + + std::map bv; + VectorTools::interpolate_boundary_values (dof_handler, + 0, + ZeroFunction(1), + bv); + for (std::map::iterator + p = bv.begin(); p!=bv.end(); ++p) + deallog << p->first << ' ' << p->second << std::endl; +} + + + +int main () +{ + std::ofstream logfile("fe_nothing_08/output"); + logfile.precision(2); + + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + test<1> (); + test<2> (); + test<3> (); + + deallog << "OK" << std::endl; +} diff --git a/tests/hp/fe_nothing_08/cmp/generic b/tests/hp/fe_nothing_08/cmp/generic new file mode 100644 index 0000000000..f8e9b07c0b --- /dev/null +++ b/tests/hp/fe_nothing_08/cmp/generic @@ -0,0 +1,28 @@ + +DEAL::2 dofs +DEAL::0 0 +DEAL::6 dofs +DEAL::0 0 +DEAL::1 0 +DEAL::2 0 +DEAL::4 0 +DEAL::5 0 +DEAL::18 dofs +DEAL::0 0 +DEAL::1 0 +DEAL::2 0 +DEAL::3 0 +DEAL::4 0 +DEAL::5 0 +DEAL::6 0 +DEAL::8 0 +DEAL::9 0 +DEAL::10 0 +DEAL::11 0 +DEAL::12 0 +DEAL::13 0 +DEAL::14 0 +DEAL::15 0 +DEAL::16 0 +DEAL::17 0 +DEAL::OK