From: bangerth Date: Fri, 12 Aug 2011 23:13:58 +0000 (+0000) Subject: Test new functionality also for MappingQ2. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8a99f8a4a1b531fdb4ef25f4857e0aeb550bf6a;p=dealii-svn.git Test new functionality also for MappingQ2. git-svn-id: https://svn.dealii.org/trunk@24058 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/fe/fe_face_values_1d_mapping_q2.cc b/tests/fe/fe_face_values_1d_mapping_q2.cc new file mode 100644 index 0000000000..44adb63d6c --- /dev/null +++ b/tests/fe/fe_face_values_1d_mapping_q2.cc @@ -0,0 +1,188 @@ +//------------------------------------------------------- +// rt_11.cc,v 1.3 2003/06/09 16:00:38 wolf Exp +// Version: +// +// Copyright (C) 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. +// +//------------------------------------------------------- + +// like fe_face_values_1d but testing that one can use MappingQ(2) + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define PRECISION 4 + + + +template +inline void +plot_faces(Mapping &mapping, + FiniteElement &fe, + typename DoFHandler::cell_iterator &cell) +{ + // create a QGauss<0>(4), which should + // still only have 1 quadrature point + QGauss q(4); + Assert (q.size() == 1, ExcInternalError()); + + FEFaceValues fe_values(mapping, fe, q, + UpdateFlags(update_q_points + | update_JxW_values + | update_values + | update_gradients + | update_hessians + | update_normal_vectors)); + + for (unsigned int face_nr=0; + face_nr < GeometryInfo::faces_per_cell; + ++ face_nr) + { + deallog << "Face=" << face_nr << std::endl; + fe_values.reinit(cell, face_nr); + + // print some data on the location + deallog << "x=" << fe_values.quadrature_point(0) << std::endl; + deallog << "n=" << fe_values.normal_vector(0) << std::endl; + deallog << "JxW=" << fe_values.JxW(0) << std::endl; + + // now print some data on the shape + // functions + for (unsigned int i=0; i tria; + GridGenerator::hyper_cube (tria); + + FE_Q fe_q4(2); + DoFHandler dof(tria); + dof.distribute_dofs(fe_q4); + + typename DoFHandler::cell_iterator cell = dof.begin_active(); + { + std::ostringstream ost; + ost << "MappingFace" << dim << "d-" + << mapping_name; + deallog << ost.str() << std::endl; + plot_faces(mapping, fe_q4, cell); + } + + { + std::ostringstream ost; + ost << "MappingSubface" << dim << "d-" + << mapping_name; + deallog << ost.str() << std::endl; + plot_subfaces(mapping, fe_q4, cell); + } +} + + + +int main() +{ + std::ofstream logfile ("fe_face_values_1d_mapping_q2/output"); + deallog << std::setprecision(PRECISION); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + // ----------------------- + // Tests for dim=1 + // ----------------------- + mapping_test<1>(); +} + diff --git a/tests/fe/fe_face_values_1d_mapping_q2/cmp/generic b/tests/fe/fe_face_values_1d_mapping_q2/cmp/generic new file mode 100644 index 0000000000..4bb24416f0 --- /dev/null +++ b/tests/fe/fe_face_values_1d_mapping_q2/cmp/generic @@ -0,0 +1,72 @@ + +DEAL::dim=1 +DEAL::MappingFace1d-MappingQ(2) +DEAL::Face=0 +DEAL::x=0.000 +DEAL::n=-1.000 +DEAL::JxW=1.000 +DEAL::shape_function 0: +DEAL:: phi=1.000 +DEAL:: grad phi=-3.000 +DEAL:: grad^2 phi=4.000 +DEAL::shape_function 1: +DEAL:: phi=0 +DEAL:: grad phi=-1.000 +DEAL:: grad^2 phi=4.000 +DEAL::shape_function 2: +DEAL:: phi=0 +DEAL:: grad phi=4.000 +DEAL:: grad^2 phi=-8.000 +DEAL:: +DEAL::Face=1 +DEAL::x=1.000 +DEAL::n=1.000 +DEAL::JxW=1.000 +DEAL::shape_function 0: +DEAL:: phi=0 +DEAL:: grad phi=1.000 +DEAL:: grad^2 phi=4.000 +DEAL::shape_function 1: +DEAL:: phi=1.000 +DEAL:: grad phi=3.000 +DEAL:: grad^2 phi=4.000 +DEAL::shape_function 2: +DEAL:: phi=0 +DEAL:: grad phi=-4.000 +DEAL:: grad^2 phi=-8.000 +DEAL:: +DEAL::MappingSubface1d-MappingQ(2) +DEAL::Face=0, subface=0 +DEAL::x=0.000 +DEAL::n=-1.000 +DEAL::JxW=1.000 +DEAL::shape_function 0: +DEAL:: phi=1.000 +DEAL:: grad phi=-3.000 +DEAL:: grad^2 phi=4.000 +DEAL::shape_function 1: +DEAL:: phi=0 +DEAL:: grad phi=-1.000 +DEAL:: grad^2 phi=4.000 +DEAL::shape_function 2: +DEAL:: phi=0 +DEAL:: grad phi=4.000 +DEAL:: grad^2 phi=-8.000 +DEAL:: +DEAL::Face=1, subface=0 +DEAL::x=1.000 +DEAL::n=1.000 +DEAL::JxW=1.000 +DEAL::shape_function 0: +DEAL:: phi=0 +DEAL:: grad phi=1.000 +DEAL:: grad^2 phi=4.000 +DEAL::shape_function 1: +DEAL:: phi=1.000 +DEAL:: grad phi=3.000 +DEAL:: grad^2 phi=4.000 +DEAL::shape_function 2: +DEAL:: phi=0 +DEAL:: grad phi=-4.000 +DEAL:: grad^2 phi=-8.000 +DEAL::