From bd9ea7f9669363ba0fd05ccdd02b9f6245549507 Mon Sep 17 00:00:00 2001 From: bangerth Date: Sun, 19 Sep 2010 17:26:04 +0000 Subject: [PATCH] Rename common include files to have suffix .h instead of .h. git-svn-id: https://svn.dealii.org/trunk@22070 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/bits/data_out_01.cc | 2 +- tests/bits/data_out_02.cc | 2 +- tests/bits/data_out_03.cc | 2 +- tests/bits/data_out_04.cc | 2 +- tests/bits/data_out_05.cc | 2 +- tests/bits/data_out_common.h | 162 +++++++++ tests/bits/data_out_faces_01.cc | 4 +- tests/bits/data_out_faces_02.cc | 4 +- tests/bits/data_out_faces_03.cc | 4 +- tests/bits/data_out_faces_04.cc | 4 +- tests/bits/data_out_rotation_01.cc | 4 +- tests/bits/data_out_rotation_02.cc | 4 +- tests/bits/data_out_rotation_03.cc | 4 +- tests/bits/data_out_rotation_04.cc | 4 +- tests/bits/data_out_stack_01.cc | 2 +- tests/bits/data_out_stack_02.cc | 2 +- tests/bits/dof_tools_00a.cc | 2 +- tests/bits/dof_tools_01a.cc | 2 +- tests/bits/dof_tools_01a_constraints_false.cc | 2 +- tests/bits/dof_tools_01a_constraints_true.cc | 2 +- tests/bits/dof_tools_01a_subdomain.cc | 2 +- tests/bits/dof_tools_01b.cc | 2 +- tests/bits/dof_tools_01b_x.cc | 2 +- tests/bits/dof_tools_01c.cc | 2 +- tests/bits/dof_tools_01d.cc | 2 +- tests/bits/dof_tools_01d_x.cc | 2 +- tests/bits/dof_tools_02a.cc | 2 +- tests/bits/dof_tools_02a_constraints_false.cc | 2 +- tests/bits/dof_tools_02a_constraints_true.cc | 2 +- tests/bits/dof_tools_02a_subdomain.cc | 2 +- tests/bits/dof_tools_02b.cc | 2 +- tests/bits/dof_tools_02b_x.cc | 2 +- tests/bits/dof_tools_02c.cc | 2 +- tests/bits/dof_tools_02d.cc | 2 +- tests/bits/dof_tools_02d_x.cc | 2 +- tests/bits/dof_tools_03.cc | 2 +- tests/bits/dof_tools_04.cc | 2 +- tests/bits/dof_tools_05.cc | 2 +- tests/bits/dof_tools_06.cc | 2 +- tests/bits/dof_tools_07.cc | 2 +- tests/bits/dof_tools_08.cc | 2 +- tests/bits/dof_tools_09.cc | 2 +- tests/bits/dof_tools_10.cc | 2 +- tests/bits/dof_tools_11.cc | 2 +- tests/bits/dof_tools_12.cc | 2 +- tests/bits/dof_tools_13.cc | 2 +- tests/bits/dof_tools_13a.cc | 2 +- tests/bits/dof_tools_14.cc | 2 +- tests/bits/dof_tools_15a.cc | 2 +- tests/bits/dof_tools_15b.cc | 2 +- tests/bits/dof_tools_15b_x.cc | 2 +- tests/bits/dof_tools_15c.cc | 2 +- tests/bits/dof_tools_15d.cc | 2 +- tests/bits/dof_tools_15d_x.cc | 2 +- tests/bits/dof_tools_16a.cc | 2 +- tests/bits/dof_tools_16b.cc | 2 +- tests/bits/dof_tools_16b_x.cc | 2 +- tests/bits/dof_tools_16c.cc | 2 +- tests/bits/dof_tools_16d.cc | 2 +- tests/bits/dof_tools_16d_x.cc | 2 +- tests/bits/dof_tools_17a.cc | 2 +- tests/bits/dof_tools_17b.cc | 2 +- tests/bits/dof_tools_17b_x.cc | 2 +- tests/bits/dof_tools_17c.cc | 2 +- tests/bits/dof_tools_17d.cc | 2 +- tests/bits/dof_tools_17d_x.cc | 2 +- tests/bits/dof_tools_18a.cc | 4 +- tests/bits/dof_tools_18b.cc | 4 +- tests/bits/dof_tools_18b_x.cc | 4 +- tests/bits/dof_tools_18c.cc | 4 +- tests/bits/dof_tools_18d.cc | 4 +- tests/bits/dof_tools_18d_x.cc | 4 +- tests/bits/dof_tools_19.cc | 2 +- tests/bits/dof_tools_20.cc | 2 +- tests/bits/dof_tools_common.h | 249 ++++++++++++++ tests/bits/fe_tools_02.cc | 2 +- tests/bits/fe_tools_03.cc | 2 +- tests/bits/fe_tools_04.cc | 2 +- tests/bits/fe_tools_05.cc | 2 +- tests/bits/fe_tools_06.cc | 2 +- tests/bits/fe_tools_07.cc | 2 +- tests/bits/fe_tools_08.cc | 2 +- tests/bits/fe_tools_09.cc | 2 +- tests/bits/fe_tools_10.cc | 2 +- tests/bits/fe_tools_11.cc | 2 +- tests/bits/fe_tools_12.cc | 2 +- tests/bits/fe_tools_13.cc | 2 +- tests/bits/fe_tools_14.cc | 2 +- tests/bits/fe_tools_common.h | 318 ++++++++++++++++++ tests/bits/fe_tools_cpfqpm_01.cc | 2 +- tests/bits/fe_tools_cpfqpm_02.cc | 2 +- tests/bits/fe_tools_cpfqpm_03.cc | 2 +- tests/bits/fe_tools_cpfqpm_04.cc | 2 +- 93 files changed, 833 insertions(+), 104 deletions(-) create mode 100644 tests/bits/data_out_common.h create mode 100644 tests/bits/dof_tools_common.h create mode 100644 tests/bits/fe_tools_common.h diff --git a/tests/bits/data_out_01.cc b/tests/bits/data_out_01.cc index b37d6943a6..980b00b0a7 100644 --- a/tests/bits/data_out_01.cc +++ b/tests/bits/data_out_01.cc @@ -12,7 +12,7 @@ //---------------------------------------------------------------------- #include "../tests.h" -#include "data_out_common.cc" +#include "data_out_common.h" #include #include diff --git a/tests/bits/data_out_02.cc b/tests/bits/data_out_02.cc index 8583ecdaae..24a28461d5 100644 --- a/tests/bits/data_out_02.cc +++ b/tests/bits/data_out_02.cc @@ -15,7 +15,7 @@ #include "../tests.h" -#include "data_out_common.cc" +#include "data_out_common.h" #include #include diff --git a/tests/bits/data_out_03.cc b/tests/bits/data_out_03.cc index 3cd1d92f49..bac2102248 100644 --- a/tests/bits/data_out_03.cc +++ b/tests/bits/data_out_03.cc @@ -16,7 +16,7 @@ // make sure that the result is the same #include "../tests.h" -#include "data_out_common.cc" +#include "data_out_common.h" #include #include diff --git a/tests/bits/data_out_04.cc b/tests/bits/data_out_04.cc index 05ddf24957..8b906ddba6 100644 --- a/tests/bits/data_out_04.cc +++ b/tests/bits/data_out_04.cc @@ -19,7 +19,7 @@ // files with vector components in them #include "../tests.h" -#include "data_out_common.cc" +#include "data_out_common.h" #include #include diff --git a/tests/bits/data_out_05.cc b/tests/bits/data_out_05.cc index 238609cb37..f45d7b318f 100644 --- a/tests/bits/data_out_05.cc +++ b/tests/bits/data_out_05.cc @@ -21,7 +21,7 @@ // more than one vector field #include "../tests.h" -#include "data_out_common.cc" +#include "data_out_common.h" #include #include diff --git a/tests/bits/data_out_common.h b/tests/bits/data_out_common.h new file mode 100644 index 0000000000..de196c0307 --- /dev/null +++ b/tests/bits/data_out_common.h @@ -0,0 +1,162 @@ +//---------------------------- dof_tools_common.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2003, 2004, 2005, 2008, 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. +// +//---------------------------- dof_tools_common.cc --------------------------- + + +// common framework for the various dof_tools_*.cc tests + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + + +// forward declaration of the function that must be provided in the +// .cc files +template +void +check_this (const DoFHandler &dof_handler, + const Vector &v_node, + const Vector &v_cell); + +// forward declaration of a variable with the name of the output file +extern std::string output_file_name; + + +// take a vector, and make a block vector out of it +void +make_block_vector (const Vector &in, + BlockVector &out) +{ + std::vector block_sizes(2); + block_sizes[0] = in.size() / 2; + block_sizes[1] = in.size() - block_sizes[0]; + + out.reinit (block_sizes); + std::copy (in.begin(), in.end(), out.begin()); +} + + + + +template +void +check (const FiniteElement &fe, + const std::string &name) +{ + deallog << "Checking " << name + << " in " << dim << "d:" + << std::endl; + + // create tria and dofhandler + // objects. set different boundary + // and sub-domain ids + Triangulation tria; + GridGenerator::hyper_cube(tria, 0., 1.); + tria.refine_global (1); + tria.begin_active()->set_refine_flag(); + tria.execute_coarsening_and_refinement (); + + DoFHandler dof_handler (tria); + dof_handler.distribute_dofs (fe); + + Vector v_node (dof_handler.n_dofs()); + for (unsigned int i=0; i v_cell (dof_handler.get_tria().n_active_cells()); + for (unsigned int i=0; i EL(deg); \ + check(EL, #EL #deg); } + +#define CHECK_ALL(EL,deg)\ + { CHECK(EL,deg,1); \ + CHECK(EL,deg,2); \ + CHECK(EL,deg,3); \ + } + + +int +main() +{ + try + { + std::ofstream logfile(output_file_name.c_str()); + deallog << std::setprecision (2); + logfile << std::setprecision (2); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + CHECK_ALL(Q,1); + CHECK_ALL(Q,2); + CHECK_ALL(Q,3); + + CHECK_ALL(DGQ,0); + CHECK_ALL(DGQ,1); + CHECK_ALL(DGQ,2); + + CHECK(Nedelec, 0, 2); + CHECK(Nedelec, 0, 3); + + return 0; + } + catch (std::exception &exc) + { + deallog << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + deallog << "Exception on processing: " << std::endl + << exc.what() << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + } + catch (...) + { + deallog << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + deallog << "Unknown exception!" << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + }; +} + diff --git a/tests/bits/data_out_faces_01.cc b/tests/bits/data_out_faces_01.cc index 27ba6060d7..6691e2127a 100644 --- a/tests/bits/data_out_faces_01.cc +++ b/tests/bits/data_out_faces_01.cc @@ -12,7 +12,7 @@ //---------------------------- data_out_faces_01.cc --------------------------- #include "../tests.h" -#include "data_out_common.cc" +#include "data_out_common.h" #include #include @@ -64,7 +64,7 @@ check_this (const DoFHandler &dof_handler, { // since we can't forward declare // check_this in this file (it is forward - // declared in data_out_common.cc), we + // declared in data_out_common.h), we // also can't make the driver file aware of // the overload for 1d. to avoid linker // errors, we can consequently not overload diff --git a/tests/bits/data_out_faces_02.cc b/tests/bits/data_out_faces_02.cc index f3dc777b95..b78ed925d7 100644 --- a/tests/bits/data_out_faces_02.cc +++ b/tests/bits/data_out_faces_02.cc @@ -14,7 +14,7 @@ // same as the the test with number _01, but check for block vectors #include "../tests.h" -#include "data_out_common.cc" +#include "data_out_common.h" #include #include @@ -72,7 +72,7 @@ check_this (const DoFHandler &dof_handler, { // since we can't forward declare // check_this in this file (it is forward - // declared in data_out_common.cc), we + // declared in data_out_common.h), we // also can't make the driver file aware of // the overload for 1d. to avoid linker // errors, we can consequently not overload diff --git a/tests/bits/data_out_faces_03.cc b/tests/bits/data_out_faces_03.cc index e3ec61306d..036ab23241 100644 --- a/tests/bits/data_out_faces_03.cc +++ b/tests/bits/data_out_faces_03.cc @@ -16,7 +16,7 @@ // make sure that the result is the same #include "../tests.h" -#include "data_out_common.cc" +#include "data_out_common.h" #include #include @@ -120,7 +120,7 @@ check_this (const DoFHandler &dof_handler, { // since we can't forward declare // check_this in this file (it is forward - // declared in data_out_common.cc), we + // declared in data_out_common.h), we // also can't make the driver file aware of // the overload for 1d. to avoid linker // errors, we can consequently not overload diff --git a/tests/bits/data_out_faces_04.cc b/tests/bits/data_out_faces_04.cc index 4b5962bb37..162beb1ece 100644 --- a/tests/bits/data_out_faces_04.cc +++ b/tests/bits/data_out_faces_04.cc @@ -19,7 +19,7 @@ // files with vector components in them #include "../tests.h" -#include "data_out_common.cc" +#include "data_out_common.h" #include #include @@ -162,7 +162,7 @@ check_this (const DoFHandler &dof_handler, { // since we can't forward declare // check_this in this file (it is forward - // declared in data_out_common.cc), we + // declared in data_out_common.h), we // also can't make the driver file aware of // the overload for 1d. to avoid linker // errors, we can consequently not overload diff --git a/tests/bits/data_out_rotation_01.cc b/tests/bits/data_out_rotation_01.cc index 17e9a546ff..4115508f63 100644 --- a/tests/bits/data_out_rotation_01.cc +++ b/tests/bits/data_out_rotation_01.cc @@ -12,7 +12,7 @@ //---------------------------- data_out_rotation_01.cc --------------------------- #include "../tests.h" -#include "data_out_common.cc" +#include "data_out_common.h" #include #include @@ -69,7 +69,7 @@ check_this (const DoFHandler &dof_handler, { // since we can't forward declare // check_this in this file (it is forward - // declared in data_out_common.cc), we + // declared in data_out_common.h), we // also can't make the driver file aware of // the overload for 1d. to avoid linker // errors, we can consequently not overload diff --git a/tests/bits/data_out_rotation_02.cc b/tests/bits/data_out_rotation_02.cc index 81f1f84c31..54a6d041b7 100644 --- a/tests/bits/data_out_rotation_02.cc +++ b/tests/bits/data_out_rotation_02.cc @@ -15,7 +15,7 @@ #include "../tests.h" -#include "data_out_common.cc" +#include "data_out_common.h" #include #include @@ -76,7 +76,7 @@ check_this (const DoFHandler &dof_handler, { // since we can't forward declare // check_this in this file (it is forward - // declared in data_out_common.cc), we + // declared in data_out_common.h), we // also can't make the driver file aware of // the overload for 1d. to avoid linker // errors, we can consequently not overload diff --git a/tests/bits/data_out_rotation_03.cc b/tests/bits/data_out_rotation_03.cc index ad335d9241..f587ee0f78 100644 --- a/tests/bits/data_out_rotation_03.cc +++ b/tests/bits/data_out_rotation_03.cc @@ -16,7 +16,7 @@ // make sure that the result is the same #include "../tests.h" -#include "data_out_common.cc" +#include "data_out_common.h" #include #include @@ -119,7 +119,7 @@ check_this (const DoFHandler &dof_handler, { // since we can't forward declare // check_this in this file (it is forward - // declared in data_out_common.cc), we + // declared in data_out_common.h), we // also can't make the driver file aware of // the overload for 1d. to avoid linker // errors, we can consequently not overload diff --git a/tests/bits/data_out_rotation_04.cc b/tests/bits/data_out_rotation_04.cc index a94b994399..cd10438697 100644 --- a/tests/bits/data_out_rotation_04.cc +++ b/tests/bits/data_out_rotation_04.cc @@ -19,7 +19,7 @@ // files with vector components in them #include "../tests.h" -#include "data_out_common.cc" +#include "data_out_common.h" #include #include @@ -161,7 +161,7 @@ check_this (const DoFHandler &dof_handler, { // since we can't forward declare // check_this in this file (it is forward - // declared in data_out_common.cc), we + // declared in data_out_common.h), we // also can't make the driver file aware of // the overload for 1d. to avoid linker // errors, we can consequently not overload diff --git a/tests/bits/data_out_stack_01.cc b/tests/bits/data_out_stack_01.cc index cad49f0d18..2a71158082 100644 --- a/tests/bits/data_out_stack_01.cc +++ b/tests/bits/data_out_stack_01.cc @@ -12,7 +12,7 @@ //---------------------------- data_out_stack_01.cc --------------------------- #include "../tests.h" -#include "data_out_common.cc" +#include "data_out_common.h" #include #include diff --git a/tests/bits/data_out_stack_02.cc b/tests/bits/data_out_stack_02.cc index 82cede56e8..1c7693cdf5 100644 --- a/tests/bits/data_out_stack_02.cc +++ b/tests/bits/data_out_stack_02.cc @@ -16,7 +16,7 @@ // on some it failed linking in the past due to non-existence of weak symbols #include "../tests.h" -#include "data_out_common.cc" +#include "data_out_common.h" #include #include diff --git a/tests/bits/dof_tools_00a.cc b/tests/bits/dof_tools_00a.cc index 3fddcbf8f9..3998f0eb6c 100644 --- a/tests/bits/dof_tools_00a.cc +++ b/tests/bits/dof_tools_00a.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1c.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" // check // DoFTools:: diff --git a/tests/bits/dof_tools_01a.cc b/tests/bits/dof_tools_01a.cc index 3c53ba6d37..483e920654 100644 --- a/tests/bits/dof_tools_01a.cc +++ b/tests/bits/dof_tools_01a.cc @@ -12,7 +12,7 @@ //---------------------------------------------------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_01a_constraints_false.cc b/tests/bits/dof_tools_01a_constraints_false.cc index 34904d0026..57e1410325 100644 --- a/tests/bits/dof_tools_01a_constraints_false.cc +++ b/tests/bits/dof_tools_01a_constraints_false.cc @@ -12,7 +12,7 @@ //---------------------------------------------------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_01a_constraints_true.cc b/tests/bits/dof_tools_01a_constraints_true.cc index 5caa2ee45b..9ab19b342b 100644 --- a/tests/bits/dof_tools_01a_constraints_true.cc +++ b/tests/bits/dof_tools_01a_constraints_true.cc @@ -12,7 +12,7 @@ //---------------------------------------------------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_01a_subdomain.cc b/tests/bits/dof_tools_01a_subdomain.cc index be9f2f6903..212f572743 100644 --- a/tests/bits/dof_tools_01a_subdomain.cc +++ b/tests/bits/dof_tools_01a_subdomain.cc @@ -12,7 +12,7 @@ //---------------------------------------------------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_01b.cc b/tests/bits/dof_tools_01b.cc index 7221ff2528..931ebee2c9 100644 --- a/tests/bits/dof_tools_01b.cc +++ b/tests/bits/dof_tools_01b.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1b.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_01b_x.cc b/tests/bits/dof_tools_01b_x.cc index 9142ee5fa9..9cbc62eae5 100644 --- a/tests/bits/dof_tools_01b_x.cc +++ b/tests/bits/dof_tools_01b_x.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1b.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_01c.cc b/tests/bits/dof_tools_01c.cc index 7a402f7ccd..7442b8ed63 100644 --- a/tests/bits/dof_tools_01c.cc +++ b/tests/bits/dof_tools_01c.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1c.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_01d.cc b/tests/bits/dof_tools_01d.cc index 3a033d0403..a9bb6237a2 100644 --- a/tests/bits/dof_tools_01d.cc +++ b/tests/bits/dof_tools_01d.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1d.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_01d_x.cc b/tests/bits/dof_tools_01d_x.cc index 9b081241cb..c779ac145c 100644 --- a/tests/bits/dof_tools_01d_x.cc +++ b/tests/bits/dof_tools_01d_x.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1d.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_02a.cc b/tests/bits/dof_tools_02a.cc index 91ccbd80e4..f34c53a967 100644 --- a/tests/bits/dof_tools_02a.cc +++ b/tests/bits/dof_tools_02a.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_2a.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_02a_constraints_false.cc b/tests/bits/dof_tools_02a_constraints_false.cc index 50ff01accd..7b4eebcd4a 100644 --- a/tests/bits/dof_tools_02a_constraints_false.cc +++ b/tests/bits/dof_tools_02a_constraints_false.cc @@ -12,7 +12,7 @@ //---------------------------------------------------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_02a_constraints_true.cc b/tests/bits/dof_tools_02a_constraints_true.cc index 0f381665a3..52c848562b 100644 --- a/tests/bits/dof_tools_02a_constraints_true.cc +++ b/tests/bits/dof_tools_02a_constraints_true.cc @@ -12,7 +12,7 @@ //---------------------------------------------------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_02a_subdomain.cc b/tests/bits/dof_tools_02a_subdomain.cc index a42f90815c..787f0b2e9f 100644 --- a/tests/bits/dof_tools_02a_subdomain.cc +++ b/tests/bits/dof_tools_02a_subdomain.cc @@ -12,7 +12,7 @@ //---------------------------------------------------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_02b.cc b/tests/bits/dof_tools_02b.cc index 1d2e6256e5..11ee7b4f1a 100644 --- a/tests/bits/dof_tools_02b.cc +++ b/tests/bits/dof_tools_02b.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_2b.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_02b_x.cc b/tests/bits/dof_tools_02b_x.cc index 62977e73ff..39480d69a0 100644 --- a/tests/bits/dof_tools_02b_x.cc +++ b/tests/bits/dof_tools_02b_x.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_2b.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_02c.cc b/tests/bits/dof_tools_02c.cc index d1ade8aba7..c137e83de8 100644 --- a/tests/bits/dof_tools_02c.cc +++ b/tests/bits/dof_tools_02c.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_2c.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_02d.cc b/tests/bits/dof_tools_02d.cc index 6e3f9a9cf4..b54403c6d1 100644 --- a/tests/bits/dof_tools_02d.cc +++ b/tests/bits/dof_tools_02d.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_2d.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_02d_x.cc b/tests/bits/dof_tools_02d_x.cc index 3a70ea7971..6d5dd931f2 100644 --- a/tests/bits/dof_tools_02d_x.cc +++ b/tests/bits/dof_tools_02d_x.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_2d.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_03.cc b/tests/bits/dof_tools_03.cc index 81f225354a..288248b76a 100644 --- a/tests/bits/dof_tools_03.cc +++ b/tests/bits/dof_tools_03.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_3.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include #include diff --git a/tests/bits/dof_tools_04.cc b/tests/bits/dof_tools_04.cc index eb31ed83f0..e797528343 100644 --- a/tests/bits/dof_tools_04.cc +++ b/tests/bits/dof_tools_04.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_4.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" // check // DoFTools::extract_hanging_node_constraints diff --git a/tests/bits/dof_tools_05.cc b/tests/bits/dof_tools_05.cc index fac861f068..02d92ebb08 100644 --- a/tests/bits/dof_tools_05.cc +++ b/tests/bits/dof_tools_05.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_5.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" // check // DoFTools::extract_boundary_dofs diff --git a/tests/bits/dof_tools_06.cc b/tests/bits/dof_tools_06.cc index 38d820304a..24b0ca6df3 100644 --- a/tests/bits/dof_tools_06.cc +++ b/tests/bits/dof_tools_06.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_6.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" // check // DoFTools::extract_subdomain_dofs diff --git a/tests/bits/dof_tools_07.cc b/tests/bits/dof_tools_07.cc index 8fb3fe421d..0b6392252f 100644 --- a/tests/bits/dof_tools_07.cc +++ b/tests/bits/dof_tools_07.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_7.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" // check // DoFTools::count_dofs_per_component diff --git a/tests/bits/dof_tools_08.cc b/tests/bits/dof_tools_08.cc index 1259dd42a6..4ae17eb7b4 100644 --- a/tests/bits/dof_tools_08.cc +++ b/tests/bits/dof_tools_08.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_8.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" // check // DoFTools::map_dof_to_boundary_indices(const DoFHandler &, diff --git a/tests/bits/dof_tools_09.cc b/tests/bits/dof_tools_09.cc index 53719f470f..86d2e01edc 100644 --- a/tests/bits/dof_tools_09.cc +++ b/tests/bits/dof_tools_09.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_9.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" // check // DoFTools::map_dof_to_boundary_indices(const DoFHandler &, diff --git a/tests/bits/dof_tools_10.cc b/tests/bits/dof_tools_10.cc index 2180d659c9..47e036ecc0 100644 --- a/tests/bits/dof_tools_10.cc +++ b/tests/bits/dof_tools_10.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_10.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_11.cc b/tests/bits/dof_tools_11.cc index 7fbd37c770..f2f6954b23 100644 --- a/tests/bits/dof_tools_11.cc +++ b/tests/bits/dof_tools_11.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_11.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_12.cc b/tests/bits/dof_tools_12.cc index 90f5b7f9c6..672cc365ec 100644 --- a/tests/bits/dof_tools_12.cc +++ b/tests/bits/dof_tools_12.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_12.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" // check // DoFTools::extract_dofs diff --git a/tests/bits/dof_tools_13.cc b/tests/bits/dof_tools_13.cc index 8fab0ea12c..14bd8f3e25 100644 --- a/tests/bits/dof_tools_13.cc +++ b/tests/bits/dof_tools_13.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_13.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_13a.cc b/tests/bits/dof_tools_13a.cc index 5766db2dcd..f4abcd45e8 100644 --- a/tests/bits/dof_tools_13a.cc +++ b/tests/bits/dof_tools_13a.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_13a.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_14.cc b/tests/bits/dof_tools_14.cc index 4a19f07b18..7700ed0bdf 100644 --- a/tests/bits/dof_tools_14.cc +++ b/tests/bits/dof_tools_14.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_14.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_15a.cc b/tests/bits/dof_tools_15a.cc index be950096da..589d3c7a0d 100644 --- a/tests/bits/dof_tools_15a.cc +++ b/tests/bits/dof_tools_15a.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1a.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_15b.cc b/tests/bits/dof_tools_15b.cc index e21d0d3637..c733555e03 100644 --- a/tests/bits/dof_tools_15b.cc +++ b/tests/bits/dof_tools_15b.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1b.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_15b_x.cc b/tests/bits/dof_tools_15b_x.cc index 853ca2938e..f6c3e6eb41 100644 --- a/tests/bits/dof_tools_15b_x.cc +++ b/tests/bits/dof_tools_15b_x.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1b.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_15c.cc b/tests/bits/dof_tools_15c.cc index 083c0f0df4..91d544d72c 100644 --- a/tests/bits/dof_tools_15c.cc +++ b/tests/bits/dof_tools_15c.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1c.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_15d.cc b/tests/bits/dof_tools_15d.cc index a79aa86b74..bbea900ad9 100644 --- a/tests/bits/dof_tools_15d.cc +++ b/tests/bits/dof_tools_15d.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1d.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_15d_x.cc b/tests/bits/dof_tools_15d_x.cc index 1528ccaf06..39d3dc85af 100644 --- a/tests/bits/dof_tools_15d_x.cc +++ b/tests/bits/dof_tools_15d_x.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1d.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_16a.cc b/tests/bits/dof_tools_16a.cc index a5806df633..be64be888c 100644 --- a/tests/bits/dof_tools_16a.cc +++ b/tests/bits/dof_tools_16a.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1a.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_16b.cc b/tests/bits/dof_tools_16b.cc index 20565b23de..a883490257 100644 --- a/tests/bits/dof_tools_16b.cc +++ b/tests/bits/dof_tools_16b.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1b.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_16b_x.cc b/tests/bits/dof_tools_16b_x.cc index 3055534e73..f6bab51993 100644 --- a/tests/bits/dof_tools_16b_x.cc +++ b/tests/bits/dof_tools_16b_x.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1b.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_16c.cc b/tests/bits/dof_tools_16c.cc index 2f80a79e1e..0ef2ac4d41 100644 --- a/tests/bits/dof_tools_16c.cc +++ b/tests/bits/dof_tools_16c.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1c.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_16d.cc b/tests/bits/dof_tools_16d.cc index 3b9d1a4955..f602d0aeab 100644 --- a/tests/bits/dof_tools_16d.cc +++ b/tests/bits/dof_tools_16d.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1d.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_16d_x.cc b/tests/bits/dof_tools_16d_x.cc index 14fa01f21b..7637aeb126 100644 --- a/tests/bits/dof_tools_16d_x.cc +++ b/tests/bits/dof_tools_16d_x.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1d.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_17a.cc b/tests/bits/dof_tools_17a.cc index eb4751a91d..b4cdab0e7d 100644 --- a/tests/bits/dof_tools_17a.cc +++ b/tests/bits/dof_tools_17a.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1a.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_17b.cc b/tests/bits/dof_tools_17b.cc index 16f8079254..4892271316 100644 --- a/tests/bits/dof_tools_17b.cc +++ b/tests/bits/dof_tools_17b.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1b.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_17b_x.cc b/tests/bits/dof_tools_17b_x.cc index 6f637f1658..e34f6f8d6a 100644 --- a/tests/bits/dof_tools_17b_x.cc +++ b/tests/bits/dof_tools_17b_x.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1b.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_17c.cc b/tests/bits/dof_tools_17c.cc index ee04cf45c4..11e63c79ee 100644 --- a/tests/bits/dof_tools_17c.cc +++ b/tests/bits/dof_tools_17c.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1c.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_17d.cc b/tests/bits/dof_tools_17d.cc index 42f5821f7d..5547b97988 100644 --- a/tests/bits/dof_tools_17d.cc +++ b/tests/bits/dof_tools_17d.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1d.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_17d_x.cc b/tests/bits/dof_tools_17d_x.cc index 59b81cd490..0415c3a11a 100644 --- a/tests/bits/dof_tools_17d_x.cc +++ b/tests/bits/dof_tools_17d_x.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1d.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check diff --git a/tests/bits/dof_tools_18a.cc b/tests/bits/dof_tools_18a.cc index 9b954d09da..4371885628 100644 --- a/tests/bits/dof_tools_18a.cc +++ b/tests/bits/dof_tools_18a.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1a.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check @@ -94,7 +94,7 @@ check_this (const DoFHandler &dof_handler) { // since we can't forward declare // check_this in this file (it is forward - // declared in dof_tools_common.cc), we + // declared in dof_tools_common.h), we // also can't make the driver file aware of // the overload for 1d. to avoid linker // errors, we can consequently not overload diff --git a/tests/bits/dof_tools_18b.cc b/tests/bits/dof_tools_18b.cc index 8f62bf955a..e5126fd95c 100644 --- a/tests/bits/dof_tools_18b.cc +++ b/tests/bits/dof_tools_18b.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1b.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check @@ -88,7 +88,7 @@ check_this (const DoFHandler &dof_handler) { // since we can't forward declare // check_this in this file (it is forward - // declared in dof_tools_common.cc), we + // declared in dof_tools_common.h), we // also can't make the driver file aware of // the overload for 1d. to avoid linker // errors, we can consequently not overload diff --git a/tests/bits/dof_tools_18b_x.cc b/tests/bits/dof_tools_18b_x.cc index abe35467ea..47a28945d1 100644 --- a/tests/bits/dof_tools_18b_x.cc +++ b/tests/bits/dof_tools_18b_x.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1b.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check @@ -89,7 +89,7 @@ check_this (const DoFHandler &dof_handler) { // since we can't forward declare // check_this in this file (it is forward - // declared in dof_tools_common.cc), we + // declared in dof_tools_common.h), we // also can't make the driver file aware of // the overload for 1d. to avoid linker // errors, we can consequently not overload diff --git a/tests/bits/dof_tools_18c.cc b/tests/bits/dof_tools_18c.cc index 5b10b70c52..187e4d3428 100644 --- a/tests/bits/dof_tools_18c.cc +++ b/tests/bits/dof_tools_18c.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1c.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check @@ -123,7 +123,7 @@ check_this (const DoFHandler &dof_handler) { // since we can't forward declare // check_this in this file (it is forward - // declared in dof_tools_common.cc), we + // declared in dof_tools_common.h), we // also can't make the driver file aware of // the overload for 1d. to avoid linker // errors, we can consequently not overload diff --git a/tests/bits/dof_tools_18d.cc b/tests/bits/dof_tools_18d.cc index 5326a5c27b..b2ca187bad 100644 --- a/tests/bits/dof_tools_18d.cc +++ b/tests/bits/dof_tools_18d.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1d.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check @@ -122,7 +122,7 @@ check_this (const DoFHandler &dof_handler) { // since we can't forward declare // check_this in this file (it is forward - // declared in dof_tools_common.cc), we + // declared in dof_tools_common.h), we // also can't make the driver file aware of // the overload for 1d. to avoid linker // errors, we can consequently not overload diff --git a/tests/bits/dof_tools_18d_x.cc b/tests/bits/dof_tools_18d_x.cc index d19d168422..0cf0dd7ad1 100644 --- a/tests/bits/dof_tools_18d_x.cc +++ b/tests/bits/dof_tools_18d_x.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_1d.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include // check @@ -122,7 +122,7 @@ check_this (const DoFHandler &dof_handler) { // since we can't forward declare // check_this in this file (it is forward - // declared in dof_tools_common.cc), we + // declared in dof_tools_common.h), we // also can't make the driver file aware of // the overload for 1d. to avoid linker // errors, we can consequently not overload diff --git a/tests/bits/dof_tools_19.cc b/tests/bits/dof_tools_19.cc index 52b7691ea9..6a4eee1f99 100644 --- a/tests/bits/dof_tools_19.cc +++ b/tests/bits/dof_tools_19.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_19.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" #include #include #include diff --git a/tests/bits/dof_tools_20.cc b/tests/bits/dof_tools_20.cc index 4055fd8432..ed57b46f9a 100644 --- a/tests/bits/dof_tools_20.cc +++ b/tests/bits/dof_tools_20.cc @@ -12,7 +12,7 @@ //---------------------------- dof_tools_5.cc --------------------------- #include "../tests.h" -#include "dof_tools_common.cc" +#include "dof_tools_common.h" // check // DoFTools::extract_dofs_with_support_on_boundary diff --git a/tests/bits/dof_tools_common.h b/tests/bits/dof_tools_common.h new file mode 100644 index 0000000000..67bb978c92 --- /dev/null +++ b/tests/bits/dof_tools_common.h @@ -0,0 +1,249 @@ +//---------------------------- dof_tools_common.h --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2003, 2004, 2005, 2006, 2008, 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. +// +//---------------------------- dof_tools_common.h --------------------------- + + +// common framework for the various dof_tools_*.cc tests + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + + +// forward declaration of the function that must be provided in the +// .cc files +template +void +check_this (const DoFHandler &dof_handler); + +// forward declaration of a variable with the name of the output file +extern std::string output_file_name; + + +void +output_bool_vector (std::vector &v) +{ +for (unsigned int i=0; i +void +set_boundary_ids (Triangulation &tria) +{ + for (unsigned int f=0; f::faces_per_cell; ++f) + tria.begin_active()->face(f)->set_boundary_indicator (f); +} + + +void +set_boundary_ids (Triangulation<1> &) +{} + + + +template +void +check (const FiniteElement &fe, + const std::string &name) +{ + deallog << "Checking " << name + << " in " << dim << "d:" + << std::endl; + + // create tria and dofhandler + // objects. set different boundary + // and sub-domain ids + Triangulation tria; + GridGenerator::hyper_cube(tria, 0., 1.); + set_boundary_ids (tria); + tria.refine_global (1); + for (int i=0; i<2; ++i) + { + tria.begin_active()->set_refine_flag(); + tria.execute_coarsening_and_refinement (); + } + for (typename Triangulation::active_cell_iterator + cell=tria.begin_active(); + cell!=tria.end(); ++cell) + cell->set_subdomain_id (cell->level()); + DoFHandler dof_handler (tria); + dof_handler.distribute_dofs (fe); + + // call main function in .cc files + check_this (dof_handler); +} + + + + + +#define CHECK(EL,deg,dim)\ + { FE_ ## EL EL(deg); \ + check(EL, #EL #deg); } + +#define CHECK_SYS1(sub1,N1,dim) \ + { FESystem q(sub1, N1); \ + check(q, #sub1 #N1); } + +#define CHECK_SYS2(sub1,N1,sub2,N2,dim) \ + { FESystem q(sub1, N1, sub2, N2); \ + check(q, #sub1 #N1 #sub2 #N2); } + +#define CHECK_SYS3(sub1,N1,sub2,N2,sub3,N3,dim) \ + { FESystem q(sub1, N1, sub2, N2, sub3, N3); \ + check(q, #sub1 #N1 #sub2 #N2 #sub3 #N3); } + + +#define CHECK_ALL(EL,deg)\ + { CHECK(EL,deg,1); \ + CHECK(EL,deg,2); \ + CHECK(EL,deg,3); \ + } + + +int +main() +{ + try + { + std::ofstream logfile(output_file_name.c_str()); + logfile << std::setprecision (2); + deallog << std::setprecision (2); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + CHECK_ALL(Q,1); + CHECK_ALL(Q,2); + CHECK_ALL(Q,3); + + CHECK_ALL(DGQ,0); + CHECK_ALL(DGQ,1); + CHECK_ALL(DGQ,3); + + CHECK_ALL(DGP,0); + CHECK_ALL(DGP,1); + CHECK_ALL(DGP,3); + + CHECK(Nedelec, 0, 2); + CHECK(Nedelec, 0, 3); + + CHECK(RaviartThomas, 0, 2); + CHECK(RaviartThomas, 1, 2); + CHECK(RaviartThomas, 2, 2); + + CHECK(RaviartThomasNodal, 0, 2); + CHECK(RaviartThomasNodal, 1, 2); + CHECK(RaviartThomasNodal, 2, 2); + CHECK(RaviartThomasNodal, 0, 3); + CHECK(RaviartThomasNodal, 1, 3); + CHECK(RaviartThomasNodal, 2, 3); + + CHECK_SYS1(FE_Q<1>(1), 3,1); + CHECK_SYS1(FE_DGQ<1>(2),2,1); + CHECK_SYS1(FE_DGP<1>(3),1,1); + + CHECK_SYS1(FE_Q<2>(1), 3,2); + CHECK_SYS1(FE_DGQ<2>(2),2,2); + CHECK_SYS1(FE_DGP<2>(3),1,2); + + CHECK_SYS1(FE_Q<3>(1), 3,3); + CHECK_SYS1(FE_DGQ<3>(2),2,3); + CHECK_SYS1(FE_DGP<3>(3),1,3); + + + CHECK_SYS2(FE_Q<1>(1), 3,FE_DGQ<1>(2),2,1); + CHECK_SYS2(FE_DGQ<1>(2),2,FE_DGP<1>(3),1,1); + CHECK_SYS2(FE_DGP<1>(3),1,FE_DGQ<1>(2),2,1); + + CHECK_SYS2(FE_Q<2>(1), 3,FE_DGQ<2>(2),2,2); + CHECK_SYS2(FE_DGQ<2>(2),2,FE_DGP<2>(3),1,2); + CHECK_SYS2(FE_DGP<2>(3),1,FE_DGQ<2>(2),2,2); + + CHECK_SYS3(FE_Q<1>(1), 3,FE_DGP<1>(3),1,FE_Q<1>(1),3,1); + CHECK_SYS3(FE_DGQ<1>(2),2,FE_DGQ<1>(2),2,FE_Q<1>(3),3,1); + CHECK_SYS3(FE_DGP<1>(3),1,FE_DGP<1>(3),1,FE_Q<1>(2),3,1); + + CHECK_SYS3(FE_Q<2>(1), 3,FE_DGP<2>(3),1,FE_Q<2>(1),3,2); + CHECK_SYS3(FE_DGQ<2>(2),2,FE_DGQ<2>(2),2,FE_Q<2>(3),3,2); + CHECK_SYS3(FE_DGP<2>(3),1,FE_DGP<2>(3),1,FE_Q<2>(2),3,2); + + CHECK_SYS3(FE_DGQ<3>(1), 3,FE_DGP<3>(3),1,FE_Q<3>(1),3,3); + + // systems of systems + CHECK_SYS3((FESystem<2>(FE_Q<2>(1),3)), 3, + FE_DGQ<2>(0), 1, + FE_Q<2>(1), 3, + 2); + CHECK_SYS3(FE_DGQ<2>(3), 1, + FESystem<2>(FE_DGQ<2>(0),3), 1, + FESystem<2>(FE_Q<2>(2),1, + FE_DGQ<2>(0),1),2, + 2); + + // systems with Nedelec elements + CHECK_SYS2 (FE_DGQ<2>(3), 1, + FE_Nedelec<2>(0), 2, + 2); + CHECK_SYS3(FE_Nedelec<2>(0), 1, + FESystem<2>(FE_DGQ<2>(1),2), 1, + FESystem<2>(FE_Q<2>(2),1, + FE_Nedelec<2>(0),2),2, + 2); + + return 0; + } + catch (std::exception &exc) + { + deallog << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + deallog << "Exception on processing: " << std::endl + << exc.what() << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + } + catch (...) + { + deallog << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + deallog << "Unknown exception!" << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + }; +} + diff --git a/tests/bits/fe_tools_02.cc b/tests/bits/fe_tools_02.cc index 5498ae3637..7e80451edd 100644 --- a/tests/bits/fe_tools_02.cc +++ b/tests/bits/fe_tools_02.cc @@ -12,7 +12,7 @@ //---------------------------- fe_tools_02.cc --------------------------- #include "../tests.h" -#include "fe_tools_common.cc" +#include "fe_tools_common.h" #include // check diff --git a/tests/bits/fe_tools_03.cc b/tests/bits/fe_tools_03.cc index 625d2c1f2c..f9ccb76383 100644 --- a/tests/bits/fe_tools_03.cc +++ b/tests/bits/fe_tools_03.cc @@ -12,7 +12,7 @@ //---------------------------- fe_tools_03.cc --------------------------- #include "../tests.h" -#include "fe_tools_common.cc" +#include "fe_tools_common.h" #include // check diff --git a/tests/bits/fe_tools_04.cc b/tests/bits/fe_tools_04.cc index a39af2b25d..04c70bb81f 100644 --- a/tests/bits/fe_tools_04.cc +++ b/tests/bits/fe_tools_04.cc @@ -12,7 +12,7 @@ //---------------------------- fe_tools_04.cc --------------------------- #include "../tests.h" -#include "fe_tools_common.cc" +#include "fe_tools_common.h" #include // check diff --git a/tests/bits/fe_tools_05.cc b/tests/bits/fe_tools_05.cc index 2a2c7664de..df55e197f0 100644 --- a/tests/bits/fe_tools_05.cc +++ b/tests/bits/fe_tools_05.cc @@ -12,7 +12,7 @@ //---------------------------- fe_tools_05.cc --------------------------- #include "../tests.h" -#include "fe_tools_common.cc" +#include "fe_tools_common.h" #include // check diff --git a/tests/bits/fe_tools_06.cc b/tests/bits/fe_tools_06.cc index fd6a978c34..66c43c464f 100644 --- a/tests/bits/fe_tools_06.cc +++ b/tests/bits/fe_tools_06.cc @@ -12,7 +12,7 @@ //---------------------------- fe_tools_06.cc --------------------------- #include "../tests.h" -#include "fe_tools_common.cc" +#include "fe_tools_common.h" #include // check diff --git a/tests/bits/fe_tools_07.cc b/tests/bits/fe_tools_07.cc index 11df65e009..c8fad0dde8 100644 --- a/tests/bits/fe_tools_07.cc +++ b/tests/bits/fe_tools_07.cc @@ -12,7 +12,7 @@ //---------------------------- fe_tools_07.cc --------------------------- #include "../tests.h" -#include "fe_tools_common.cc" +#include "fe_tools_common.h" #include // check diff --git a/tests/bits/fe_tools_08.cc b/tests/bits/fe_tools_08.cc index b7c6a548dc..0d80ff8bad 100644 --- a/tests/bits/fe_tools_08.cc +++ b/tests/bits/fe_tools_08.cc @@ -12,7 +12,7 @@ //---------------------------- fe_tools_08.cc --------------------------- #include "../tests.h" -#include "fe_tools_common.cc" +#include "fe_tools_common.h" #include // check diff --git a/tests/bits/fe_tools_09.cc b/tests/bits/fe_tools_09.cc index 8ccb539279..772e4230a8 100644 --- a/tests/bits/fe_tools_09.cc +++ b/tests/bits/fe_tools_09.cc @@ -12,7 +12,7 @@ //---------------------------- fe_tools_09.cc --------------------------- #include "../tests.h" -#include "fe_tools_common.cc" +#include "fe_tools_common.h" #include // check diff --git a/tests/bits/fe_tools_10.cc b/tests/bits/fe_tools_10.cc index 1a30242177..1fb6ee9722 100644 --- a/tests/bits/fe_tools_10.cc +++ b/tests/bits/fe_tools_10.cc @@ -12,7 +12,7 @@ //---------------------------- fe_tools_10.cc --------------------------- #include "../tests.h" -#include "fe_tools_common.cc" +#include "fe_tools_common.h" #include // check diff --git a/tests/bits/fe_tools_11.cc b/tests/bits/fe_tools_11.cc index c3e7f093b6..f77f62889e 100644 --- a/tests/bits/fe_tools_11.cc +++ b/tests/bits/fe_tools_11.cc @@ -12,7 +12,7 @@ //---------------------------- fe_tools_11.cc --------------------------- #include "../tests.h" -#include "fe_tools_common.cc" +#include "fe_tools_common.h" #include // check diff --git a/tests/bits/fe_tools_12.cc b/tests/bits/fe_tools_12.cc index e586103d29..0cbc2f1559 100644 --- a/tests/bits/fe_tools_12.cc +++ b/tests/bits/fe_tools_12.cc @@ -12,7 +12,7 @@ //---------------------------- fe_tools_12.cc --------------------------- #include "../tests.h" -#include "fe_tools_common.cc" +#include "fe_tools_common.h" // check // FETools::get_projection_matrix diff --git a/tests/bits/fe_tools_13.cc b/tests/bits/fe_tools_13.cc index ef711335f9..5d401922a2 100644 --- a/tests/bits/fe_tools_13.cc +++ b/tests/bits/fe_tools_13.cc @@ -12,7 +12,7 @@ //---------------------------- fe_tools_13.cc --------------------------- #include "../tests.h" -#include "fe_tools_common.cc" +#include "fe_tools_common.h" // check // FE::face_to_equivalent_cell_index diff --git a/tests/bits/fe_tools_14.cc b/tests/bits/fe_tools_14.cc index 24fab8adb5..7cfbca70d5 100644 --- a/tests/bits/fe_tools_14.cc +++ b/tests/bits/fe_tools_14.cc @@ -12,7 +12,7 @@ //---------------------------- fe_tools_14.cc --------------------------- #include "../tests.h" -#include "fe_tools_common.cc" +#include "fe_tools_common.h" // check // FE::hp_constraints_are_implemented () diff --git a/tests/bits/fe_tools_common.h b/tests/bits/fe_tools_common.h new file mode 100644 index 0000000000..8624d1c51d --- /dev/null +++ b/tests/bits/fe_tools_common.h @@ -0,0 +1,318 @@ +//---------------------------- fe_tools_common.h --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2003, 2004, 2005, 2006, 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. +// +//---------------------------- fe_tools_common.h --------------------------- + + +// common framework for the various fe_tools_*.cc tests + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + + +// forward declaration of the function that must be provided in the +// .cc files +template +void +check_this (const FiniteElement &fe1, + const FiniteElement &fe2); + +// forward declaration of a variable with the name of the output file +extern std::string output_file_name; + + + +// output some indicators for a given matrix. we don't write out the +// entire matrix since this would blow up our output files beyond +// reasonable limits +void +output_matrix (const FullMatrix &m) +{ + if ((m.m() == 0) || (m.n() == 0)) + { + deallog << "(Empty matrix)" << std::endl; + return; + } + + deallog << m.l1_norm() << ' ' << m.linfty_norm() + << std::endl; + if (m.m() == m.n()) + deallog << m.frobenius_norm() << std::endl; + + for (unsigned int i=0; i +void +output_vector (const VECTOR &v) +{ + deallog << v.l1_norm() << ' ' << v.l2_norm() << ' ' << v.linfty_norm() + << std::endl; + + // write out at most 20 equispaced + // elements of the vector + for (unsigned int i=0; i +Triangulation * make_tria () +{ + Triangulation *tria = new Triangulation(); + GridGenerator::hyper_cube(*tria, 0., 1.); + tria->refine_global (1); + for (int i=0; i<2; ++i) + { + tria->begin_active()->set_refine_flag(); + tria->execute_coarsening_and_refinement (); + } + return tria; +} + + + +template +DoFHandler * make_dof_handler (const Triangulation &tria, + const FiniteElement &fe) +{ + DoFHandler *dof_handler = new DoFHandler(tria); + dof_handler->distribute_dofs (fe); + return dof_handler; +} + + + +template +void +check (const FiniteElement &fe1, + const FiniteElement &fe2, + const std::string &name) +{ + deallog << "Checking " << name + << " in " << dim << "d:" + << std::endl; + + // call main function in .cc files + check_this (fe1, fe2); +} + + + + + +#define CHECK(EL1,deg1,EL2,deg2,dim)\ + { FE_ ## EL1 fe1(deg1); \ + FE_ ## EL2 fe2(deg2); \ + check(fe1, fe2, #EL1 #deg1 " against " #EL2 #deg2); \ + check(fe2, fe1, #EL2 #deg2 " against " #EL1 #deg1); \ + } + +#define CHECK_SYS1(sub1_1,N1_1,sub2_1,N2_1,dim) \ + { FESystem fe1(sub1_1, N1_1); \ + FESystem fe2(sub2_1, N2_1); \ + check(fe1, fe2, #sub1_1 #N1_1 " against " #sub2_1 #N2_1); \ + check(fe2, fe1, #sub2_1 #N2_1 " against " #sub1_1 #N1_1); \ + } + +/* +#define CHECK_SYS2(sub1,N1,sub2,N2,dim) \ + { FESystem q(sub1, N1, sub2, N2); \ + check(q, #sub1 #N1 #sub2 #N2); } + +#define CHECK_SYS3(sub1,N1,sub2,N2,sub3,N3,dim) \ + { FESystem q(sub1, N1, sub2, N2, sub3, N3); \ + check(q, #sub1 #N1 #sub2 #N2 #sub3 #N3); } + +*/ +#define CHECK_ALL(EL1,deg1,EL2,deg2)\ + { CHECK(EL1,deg1,EL2,deg2,1); \ + CHECK(EL1,deg1,EL2,deg2,2); \ + CHECK(EL1,deg1,EL2,deg2,3); \ + } + + +int +main() +{ + try + { + std::ofstream logfile(output_file_name.c_str()); + deallog << std::setprecision (2); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + CHECK_ALL(Q,1,Q,1); + CHECK_ALL(Q,1,Q,2); + CHECK_ALL(Q,1,Q,3); + CHECK_ALL(Q,2,Q,2); + CHECK_ALL(Q,2,Q,3); + CHECK_ALL(Q,3,Q,3); + + CHECK_ALL(DGQ,0,DGQ,0); + CHECK_ALL(DGQ,0,DGQ,1); + CHECK_ALL(DGQ,0,DGQ,2); + CHECK_ALL(DGQ,0,DGQ,4); + CHECK_ALL(DGQ,1,DGQ,1); + CHECK_ALL(DGQ,1,DGQ,3); + CHECK_ALL(DGQ,2,DGQ,2); + CHECK_ALL(DGQ,2,DGQ,2); + CHECK_ALL(DGQ,2,DGQ,4); + CHECK_ALL(DGQ,3,DGQ,3); + + CHECK_ALL(DGP,0,DGP,0); + CHECK_ALL(DGP,0,DGP,1); + CHECK_ALL(DGP,0,DGP,2); + CHECK_ALL(DGP,0,DGP,4); + CHECK_ALL(DGP,1,DGP,1); + CHECK_ALL(DGP,1,DGP,3); + CHECK_ALL(DGP,2,DGP,2); + CHECK_ALL(DGP,2,DGP,2); + CHECK_ALL(DGP,2,DGP,4); + CHECK_ALL(DGP,3,DGP,3); + + CHECK(Nedelec, 0, Nedelec, 0, 2); + CHECK(Nedelec, 0, Nedelec, 0, 3); + + + CHECK_SYS1(FE_Q<1>(1), 3, + FE_Q<1>(2), 3, + 1); + CHECK_SYS1(FE_DGQ<1>(2),2, + FE_DGQ<1>(3),2, + 1); + CHECK_SYS1(FE_DGP<1>(3),1, + FE_DGP<1>(1),1, + 1); + + CHECK_SYS1(FE_Q<2>(1), 3, + FE_Q<2>(2), 3, + 2); + CHECK_SYS1(FE_DGQ<2>(2),2, + FE_DGQ<2>(3),2, + 2); + CHECK_SYS1(FE_DGP<2>(3),1, + FE_DGP<2>(1),1, + 2); + + CHECK_SYS1(FE_Q<3>(1), 3, + FE_Q<3>(2), 3, + 3); + CHECK_SYS1(FE_DGQ<3>(2),2, + FE_DGQ<3>(3),2, + 3); + CHECK_SYS1(FE_DGP<3>(3),1, + FE_DGP<3>(1),1, + 3); + + +/* + CHECK_SYS2(FE_Q<1>(1), 3,FE_DGQ<1>(2),2,1); + CHECK_SYS2(FE_DGQ<1>(2),2,FE_DGP<1>(3),1,1); + CHECK_SYS2(FE_DGP<1>(3),1,FE_DGQ<1>(2),2,1); + + CHECK_SYS2(FE_Q<2>(1), 3,FE_DGQ<2>(2),2,2); + CHECK_SYS2(FE_DGQ<2>(2),2,FE_DGP<2>(3),1,2); + CHECK_SYS2(FE_DGP<2>(3),1,FE_DGQ<2>(2),2,2); + + CHECK_SYS2(FE_Q<3>(1) ,3,FE_DGQ<3>(2),2,3); + CHECK_SYS2(FE_DGQ<3>(2),2,FE_DGP<3>(3),1,3); + CHECK_SYS2(FE_DGP<3>(3),1,FE_DGQ<3>(2),2,3); + + + CHECK_SYS3(FE_Q<1>(1), 3,FE_DGP<1>(3),1,FE_Q<1>(1),3,1); + CHECK_SYS3(FE_DGQ<1>(2),2,FE_DGQ<1>(2),2,FE_Q<1>(3),3,1); + CHECK_SYS3(FE_DGP<1>(3),1,FE_DGP<1>(3),1,FE_Q<1>(2),3,1); + + CHECK_SYS3(FE_Q<2>(1), 3,FE_DGP<2>(3),1,FE_Q<2>(1),3,2); + CHECK_SYS3(FE_DGQ<2>(2),2,FE_DGQ<2>(2),2,FE_Q<2>(3),3,2); + CHECK_SYS3(FE_DGP<2>(3),1,FE_DGP<2>(3),1,FE_Q<2>(2),3,2); + + CHECK_SYS3(FE_Q<3>(1), 3,FE_DGP<3>(3),1,FE_Q<3>(1),3,3); + CHECK_SYS3(FE_DGQ<3>(2),2,FE_DGQ<3>(2),2,FE_Q<3>(3),3,3); + CHECK_SYS3(FE_DGP<3>(3),1,FE_DGP<3>(3),1,FE_Q<3>(2),3,3); + + // systems of systems + CHECK_SYS3((FESystem<2>(FE_Q<2>(1),3)), 3, + FE_DGQ<2>(3), 1, + FE_Q<2>(1), 3, + 2); + CHECK_SYS3(FE_DGQ<2>(3), 1, + FESystem<2>(FE_DGQ<2>(3),3), 1, + FESystem<2>(FE_Q<2>(2),3, + FE_DGQ<2>(0),1),2, + 2); + + // systems with Nedelec elements + CHECK_SYS2 (FE_DGQ<2>(3), 1, + FE_Nedelec<2>(0), 2, + 2); + CHECK_SYS3(FE_Nedelec<2>(0), 1, + FESystem<2>(FE_DGQ<2>(3),3), 1, + FESystem<2>(FE_Q<2>(2),3, + FE_Nedelec<2>(0),2),2, + 2); +*/ + return 0; + } + catch (std::exception &exc) + { + deallog << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + deallog << "Exception on processing: " << std::endl + << exc.what() << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + } + catch (...) + { + deallog << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + deallog << "Unknown exception!" << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + }; +} + diff --git a/tests/bits/fe_tools_cpfqpm_01.cc b/tests/bits/fe_tools_cpfqpm_01.cc index c667375a55..2cf444b9c0 100644 --- a/tests/bits/fe_tools_cpfqpm_01.cc +++ b/tests/bits/fe_tools_cpfqpm_01.cc @@ -12,7 +12,7 @@ //---------------------------- fe_tools_cpfqpm_01.cc --------------------------- #include "../tests.h" -#include "fe_tools_common.cc" +#include "fe_tools_common.h" #include // check diff --git a/tests/bits/fe_tools_cpfqpm_02.cc b/tests/bits/fe_tools_cpfqpm_02.cc index 2581691dc4..815bc90e60 100644 --- a/tests/bits/fe_tools_cpfqpm_02.cc +++ b/tests/bits/fe_tools_cpfqpm_02.cc @@ -12,7 +12,7 @@ //---------------------------- fe_tools_cpfqpm_02.cc --------------------------- #include "../tests.h" -#include "fe_tools_common.cc" +#include "fe_tools_common.h" #include // check diff --git a/tests/bits/fe_tools_cpfqpm_03.cc b/tests/bits/fe_tools_cpfqpm_03.cc index 7fcc40cd16..c8178f9815 100644 --- a/tests/bits/fe_tools_cpfqpm_03.cc +++ b/tests/bits/fe_tools_cpfqpm_03.cc @@ -12,7 +12,7 @@ //---------------------------- fe_tools_cpfqpm_03.cc --------------------------- #include "../tests.h" -#include "fe_tools_common.cc" +#include "fe_tools_common.h" #include // check diff --git a/tests/bits/fe_tools_cpfqpm_04.cc b/tests/bits/fe_tools_cpfqpm_04.cc index 8ed81b5cb9..8cbc834e9b 100644 --- a/tests/bits/fe_tools_cpfqpm_04.cc +++ b/tests/bits/fe_tools_cpfqpm_04.cc @@ -12,7 +12,7 @@ //---------------------------- fe_tools_cpfqpm_04.cc --------------------------- #include "../tests.h" -#include "fe_tools_common.cc" +#include "fe_tools_common.h" #include // check -- 2.39.5