From: Wolfgang Bangerth Date: Tue, 10 Jun 2008 20:50:51 +0000 (+0000) Subject: Remove commented out part of the code. This will be made into a separate test. X-Git-Tag: v8.0.0~9020 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee4e0931e2277da7d2ae3d84395cdc89eda1116a;p=dealii.git Remove commented out part of the code. This will be made into a separate test. git-svn-id: https://svn.dealii.org/trunk@16289 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/fail/mesh_3d_22.cc b/tests/fail/mesh_3d_22.cc index a6b0be6654..24f4afa014 100644 --- a/tests/fail/mesh_3d_22.cc +++ b/tests/fail/mesh_3d_22.cc @@ -130,39 +130,5 @@ int main () std::ifstream inputStream("mesh_3d_22/mesh.msh"); grid_in.read_msh (inputStream); test<3>(triangulation); - - -/* - MappingQ<3> mapping(3); - - FE_Q<3> fe(3); - DoFHandler<3> dofh(triangulation); - - - dofh.distribute_dofs(fe); - - { - Vector x(dofh.n_dofs()); - DataOut<3> data_out; - - data_out.attach_dof_handler(dofh); - data_out.add_data_vector(x, "u"); - data_out.build_patches(mapping, 3); - - std::ofstream output("out.gpl"); - data_out.write(output, data_out.parse_output_format("gnuplot")); - } - - Point<3> p; - for (double x=0;x<=1;x+=1.0/3.0) - { - p(0)=x; - p(1)=1.0/3.0; - p(2)=0.0; - - Point<3> r=mapping.transform_unit_to_real_cell(++triangulation.begin_active(),p); - deallog << p << " > " << r << std::endl; - } -*/ } diff --git a/tests/fail/mesh_3d_23.cc b/tests/fail/mesh_3d_23.cc new file mode 100644 index 0000000000..a6b0be6654 --- /dev/null +++ b/tests/fail/mesh_3d_23.cc @@ -0,0 +1,168 @@ +//---------------------------- mesh_3d_22.cc --------------------------- +// $Id: mesh_3d_22.cc 15662 2008-01-24 05:31:14Z kanschat $ +// Version: $Name$ +// +// Copyright (C) 2006, 2008 by Timo Heister and 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_22.cc --------------------------- + + +// an adaptation of the deal.II/interpolate_q_01 test. check that +// VectorTools::interpolate works for FE_Q(p) elements correctly on a mesh +// with a cell that has a wrong face orientation. when using a MappingQ(3), we +// calculated interpolation points wrongly + +#include "../tests.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +using namespace dealii; +using namespace std; + +template +class F : public Function +{ + public: + F (const unsigned int q) : q(q) {} + + virtual double value (const Point &p, + const unsigned int) const + { + double v=0; + for (unsigned int d=0; d +void test (Triangulation& triangulation) +{ + MappingQ<3> mapping(3); + for (unsigned int p=1; p<7-dim; ++p) + { + FE_Q fe(p); + DoFHandler dof_handler(triangulation); + dof_handler.distribute_dofs (fe); + + Vector interpolant (dof_handler.n_dofs()); + Vector error (triangulation.n_active_cells()); + for (unsigned int q=0; q<=p+2; ++q) + { + // interpolate the function + VectorTools::interpolate (mapping, dof_handler, + F (q), + interpolant); + + // then compute the interpolation error + VectorTools::integrate_difference (mapping, dof_handler, + interpolant, + F (q), + error, + QGauss(q+2), + VectorTools::L2_norm); + deallog << fe.get_name() << ", P_" << q + << ", rel. error=" << error.l2_norm() / interpolant.l2_norm() + << std::endl; + if (q<=p) + Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(), + ExcInternalError()); + } + } +} + + + + +int main () +{ + std::ofstream logfile ("mesh_3d_22/output"); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.0e-10); + + Triangulation<3> triangulation; + GridIn<3> grid_in; + grid_in.attach_triangulation(triangulation); + std::ifstream inputStream("mesh_3d_22/mesh.msh"); + grid_in.read_msh (inputStream); + test<3>(triangulation); + + +/* + MappingQ<3> mapping(3); + + FE_Q<3> fe(3); + DoFHandler<3> dofh(triangulation); + + + dofh.distribute_dofs(fe); + + { + Vector x(dofh.n_dofs()); + DataOut<3> data_out; + + data_out.attach_dof_handler(dofh); + data_out.add_data_vector(x, "u"); + data_out.build_patches(mapping, 3); + + std::ofstream output("out.gpl"); + data_out.write(output, data_out.parse_output_format("gnuplot")); + } + + Point<3> p; + for (double x=0;x<=1;x+=1.0/3.0) + { + p(0)=x; + p(1)=1.0/3.0; + p(2)=0.0; + + Point<3> r=mapping.transform_unit_to_real_cell(++triangulation.begin_active(),p); + deallog << p << " > " << r << std::endl; + } +*/ +} + diff --git a/tests/fail/mesh_3d_23/mesh.msh b/tests/fail/mesh_3d_23/mesh.msh new file mode 100644 index 0000000000..1720c7a637 --- /dev/null +++ b/tests/fail/mesh_3d_23/mesh.msh @@ -0,0 +1,20 @@ +$NOD +12 +1 1.5 0.2 0 +2 1.5 0.4 0 +3 1.5 0.6 0 +4 2.0 0.2 0 +5 2.0 0.4 0 +6 2.0 0.6 0 +7 1.5 0.2 0.205 +8 1.5 0.4 0.205 +9 1.5 0.6 0.205 +10 2.0 0.2 0.205 +11 2.0 0.4 0.205 +12 2.0 0.6 0.205 +$ENDNOD +$ELM +2 +1 5 30 1 8 5 6 3 2 11 12 9 8 +2 5 30 1 8 5 2 1 4 11 8 7 10 +$ENDELM