From: pauletti Date: Thu, 1 Mar 2012 20:48:38 +0000 (+0000) Subject: Test that compare the kelly estimator for the same mesh, when consider X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a69d6b2b7f8306b57031765e85ae208e2b9197e;p=dealii-svn.git Test that compare the kelly estimator for the same mesh, when consider as codim 0 or as codim 1 git-svn-id: https://svn.dealii.org/trunk@25196 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/deal.II/error_estimator_01.cc b/tests/deal.II/error_estimator_01.cc new file mode 100644 index 0000000000..d40790b8c2 --- /dev/null +++ b/tests/deal.II/error_estimator_01.cc @@ -0,0 +1,90 @@ +//---------------------------- error_estimator_01.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2000, 2001, 2003, 2004, 2007, 2010 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. +// +//---------------------------- error_estimator_01.cc --------------------------- + + +/* Compare the kelly estimator for the same square but in codimension 0 and the other in codimension 1, + Both should return the same estimator */ + + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +template +void +check () +{ + Functions::CosineFunction function; + Triangulation tr; + + GridGenerator::hyper_cube(tr, -1,1); + + tr.refine_global (1); + tr.begin_active()->set_refine_flag (); + tr.execute_coarsening_and_refinement (); + + + FE_Q element(3); + DoFHandler dof(tr); + dof.distribute_dofs(element); + + MappingQ mapping(3); + QGauss q_face(4); + + std::map*> neumann_bc; + neumann_bc[0] = &function; + + Vector v (dof.n_dofs()); + VectorTools::interpolate (mapping, dof, function, v); + + Vector error (tr.n_active_cells()); + + KellyErrorEstimator::estimate (mapping, dof, q_face, neumann_bc, + v, error); + + deallog << "Estimated error:" << std::endl; + for (unsigned int i=0; i (); + deallog.pop (); + deallog.push ("2d_3"); + check<2,3> (); + deallog.pop (); +} diff --git a/tests/deal.II/error_estimator_01/cmp/generic b/tests/deal.II/error_estimator_01/cmp/generic new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/tests/deal.II/error_estimator_01/cmp/generic @@ -0,0 +1 @@ +