From: Wolfgang Bangerth Date: Thu, 11 Dec 2014 02:46:29 +0000 (-0600) Subject: Add a test. X-Git-Tag: v8.2.0-rc1~22^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F294%2Fhead;p=dealii.git Add a test. --- diff --git a/tests/hp/interpolate_nothing_01.cc b/tests/hp/interpolate_nothing_01.cc new file mode 100644 index 0000000000..9803f2899a --- /dev/null +++ b/tests/hp/interpolate_nothing_01.cc @@ -0,0 +1,87 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2014 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- + + + +// check that VectorTools::interpolate works for FE_Nothing +// elements. this is another confirmation that we had previously fixed +// a bug again reported by Krishna Garikipati but that had previously +// been addressed by ensuring that +// FE_Nothing::has_unit_support_points() returns true + +#include "../tests.h" +#include +#include +#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); + triangulation.refine_global (3); + + hp::FECollection hp_fe; + hp_fe.push_back(FESystem(FE_Q(2), 1, FE_Nothing(), 1)); + hp::DoFHandler dof_handler(triangulation); + dof_handler.distribute_dofs (hp_fe); + + Vector interpolant (dof_handler.n_dofs()); + Vector error (triangulation.n_active_cells()); + + // interpolate the function + VectorTools::interpolate (dof_handler, + ZeroFunction(hp_fe[0].n_components()), + interpolant); + deallog << interpolant.l2_norm() << std::endl; +} + + + +int main () +{ + std::ofstream logfile("output"); + logfile.precision (3); + deallog << std::setprecision(3); + + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + test<1>(); + test<2>(); + test<3>(); +} + diff --git a/tests/hp/interpolate_nothing_01.output b/tests/hp/interpolate_nothing_01.output new file mode 100644 index 0000000000..70626d7e3f --- /dev/null +++ b/tests/hp/interpolate_nothing_01.output @@ -0,0 +1,4 @@ + +DEAL::0 +DEAL::0 +DEAL::0