From 1cceea560d203e8f630a2a9419e65f6e24297ff0 Mon Sep 17 00:00:00 2001 From: wolf Date: Wed, 1 Oct 2003 22:25:32 +0000 Subject: [PATCH] Add. git-svn-id: https://svn.dealii.org/trunk@8083 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/bits/mesh_3d_12.cc | 104 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 tests/bits/mesh_3d_12.cc diff --git a/tests/bits/mesh_3d_12.cc b/tests/bits/mesh_3d_12.cc new file mode 100644 index 0000000000..d87a1716f0 --- /dev/null +++ b/tests/bits/mesh_3d_12.cc @@ -0,0 +1,104 @@ +//---------------------------- mesh_3d_12.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2003 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. +// +//---------------------------- mesh_3d_12.cc --------------------------- + + +// the Kelly estimator used to fall over when presented with 3d meshes +// with mis-oriented faces + +#include "mesh_3d.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +void check_this (Triangulation<3> &tria) +{ + FE_Q<3> fe(1); + DoFHandler<3> dof_handler (tria); + dof_handler.distribute_dofs (fe); + + Vector u(dof_handler.n_dofs()); + Vector e(tria.n_active_cells()); + + KellyErrorEstimator<3>::estimate (dof_handler, + QGauss2<2>(), + FunctionMap<3>::type(), + u, + e); +} + + +void check (Triangulation<3> &tria) +{ + (++tria.begin_active())->set_refine_flag (); + tria.execute_coarsening_and_refinement (); + + deallog << "Initial check" << std::endl; + check_this (tria); + + for (unsigned int r=0; r<3; ++r) + { + tria.refine_global (1); + deallog << "Check " << r << std::endl; + check_this (tria); + } + + coarsen_global (tria); + deallog << "Check " << 1 << std::endl; + check_this (tria); + + tria.refine_global (1); + deallog << "Check " << 2 << std::endl; + check_this (tria); +} + + +int main () +{ + std::ofstream logfile("mesh_3d_12.output"); + deallog.attach(logfile); + deallog.depth_console(0); + + { + Triangulation<3> coarse_grid; + create_two_cubes (coarse_grid); + check (coarse_grid); + } + + { + Triangulation<3> coarse_grid; + create_L_shape (coarse_grid); + check (coarse_grid); + } + + { + Triangulation<3> coarse_grid; + GridGenerator::hyper_ball (coarse_grid); + check (coarse_grid); + } + +} + + + -- 2.39.5