From: Wolfgang Bangerth Date: Tue, 24 Sep 2019 02:50:59 +0000 (-0600) Subject: Undo a change to a previously existing test, add a new one. X-Git-Tag: v9.2.0-rc1~1040^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1c33636ed3afa60162d55f4f0e4c938f23fd9b8;p=dealii.git Undo a change to a previously existing test, add a new one. --- diff --git a/tests/mappings/mapping_fe_field_01.cc b/tests/mappings/mapping_fe_field_01.cc index c9e1a80428..4e82d95c12 100644 --- a/tests/mappings/mapping_fe_field_01.cc +++ b/tests/mappings/mapping_fe_field_01.cc @@ -77,8 +77,7 @@ test(const unsigned int degree) FEValues fe_values(map_fe, fe_sys, quadrature_formula, - update_values | update_JxW_values | - update_volume_elements); + update_values | update_JxW_values); typename DoFHandler::active_cell_iterator cell = dof_sys diff --git a/tests/mappings/mapping_fe_field_contravariant_01.cc b/tests/mappings/mapping_fe_field_contravariant_01.cc new file mode 100644 index 0000000000..60053aa617 --- /dev/null +++ b/tests/mappings/mapping_fe_field_contravariant_01.cc @@ -0,0 +1,111 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2001 - 2018 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE.md at +// the top level directory of deal.II. +// +// --------------------------------------------------------------------- + + +// Like mapping_fe_field_01, but add an update flag that led to an +// assertion that checked the size of the wrong field and consequently +// accidentally aborted an otherwise perfectly valid program + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include + +#include "../tests.h" + +#define PRECISION 2 + +template +void +test(const unsigned int degree) +{ + deallog << "dim = " << dim << ", spacedim = " << spacedim << std::endl; + deallog << "degree = " << degree << std::endl; + + Triangulation tria; + GridGenerator::hyper_cube(tria, 0., 1.); + tria.refine_global(2); + + FE_Bernstein fe(degree); + // FE_Q fe(degree); + FESystem fe_sys(fe, spacedim); + + // DoFHandler dof(tria); + DoFHandler dof_sys(tria); + // dof.distribute_dofs(fe); + dof_sys.distribute_dofs(fe_sys); + + Vector euler; + euler.reinit(dof_sys.n_dofs()); + const ComponentMask mask(spacedim, true); + + VectorTools::get_position_vector(dof_sys, euler, mask); + MappingFEField map_fe(dof_sys, euler, mask); + + QIterated quadrature_formula(QTrapez<1>(), fe.degree); + + FEValues fe_values(map_fe, + fe_sys, + quadrature_formula, + update_values | update_JxW_values | + update_volume_elements); + + typename DoFHandler::active_cell_iterator cell = + dof_sys + .begin_active(), + endc = dof_sys.end(); + + for (; cell != endc; ++cell) + { + fe_values.reinit(cell); + deallog << "Cell " << cell << ": OK" << std::endl; + } +} + +int +main() +{ + initlog(); + + for (unsigned int d = 1; d < 4; ++d) + { + test<2, 2>(d); + test<2, 3>(d); + test<3, 3>(d); + } +} diff --git a/tests/mappings/mapping_fe_field_contravariant_01.output b/tests/mappings/mapping_fe_field_contravariant_01.output new file mode 100644 index 0000000000..4aa17398a9 --- /dev/null +++ b/tests/mappings/mapping_fe_field_contravariant_01.output @@ -0,0 +1,307 @@ + +DEAL::dim = 2, spacedim = 2 +DEAL::degree = 1 +DEAL::Cell 2.0: OK +DEAL::Cell 2.1: OK +DEAL::Cell 2.2: OK +DEAL::Cell 2.3: OK +DEAL::Cell 2.4: OK +DEAL::Cell 2.5: OK +DEAL::Cell 2.6: OK +DEAL::Cell 2.7: OK +DEAL::Cell 2.8: OK +DEAL::Cell 2.9: OK +DEAL::Cell 2.10: OK +DEAL::Cell 2.11: OK +DEAL::Cell 2.12: OK +DEAL::Cell 2.13: OK +DEAL::Cell 2.14: OK +DEAL::Cell 2.15: OK +DEAL::dim = 2, spacedim = 3 +DEAL::degree = 1 +DEAL::Cell 2.0: OK +DEAL::Cell 2.1: OK +DEAL::Cell 2.2: OK +DEAL::Cell 2.3: OK +DEAL::Cell 2.4: OK +DEAL::Cell 2.5: OK +DEAL::Cell 2.6: OK +DEAL::Cell 2.7: OK +DEAL::Cell 2.8: OK +DEAL::Cell 2.9: OK +DEAL::Cell 2.10: OK +DEAL::Cell 2.11: OK +DEAL::Cell 2.12: OK +DEAL::Cell 2.13: OK +DEAL::Cell 2.14: OK +DEAL::Cell 2.15: OK +DEAL::dim = 3, spacedim = 3 +DEAL::degree = 1 +DEAL::Cell 2.0: OK +DEAL::Cell 2.1: OK +DEAL::Cell 2.2: OK +DEAL::Cell 2.3: OK +DEAL::Cell 2.4: OK +DEAL::Cell 2.5: OK +DEAL::Cell 2.6: OK +DEAL::Cell 2.7: OK +DEAL::Cell 2.8: OK +DEAL::Cell 2.9: OK +DEAL::Cell 2.10: OK +DEAL::Cell 2.11: OK +DEAL::Cell 2.12: OK +DEAL::Cell 2.13: OK +DEAL::Cell 2.14: OK +DEAL::Cell 2.15: OK +DEAL::Cell 2.16: OK +DEAL::Cell 2.17: OK +DEAL::Cell 2.18: OK +DEAL::Cell 2.19: OK +DEAL::Cell 2.20: OK +DEAL::Cell 2.21: OK +DEAL::Cell 2.22: OK +DEAL::Cell 2.23: OK +DEAL::Cell 2.24: OK +DEAL::Cell 2.25: OK +DEAL::Cell 2.26: OK +DEAL::Cell 2.27: OK +DEAL::Cell 2.28: OK +DEAL::Cell 2.29: OK +DEAL::Cell 2.30: OK +DEAL::Cell 2.31: OK +DEAL::Cell 2.32: OK +DEAL::Cell 2.33: OK +DEAL::Cell 2.34: OK +DEAL::Cell 2.35: OK +DEAL::Cell 2.36: OK +DEAL::Cell 2.37: OK +DEAL::Cell 2.38: OK +DEAL::Cell 2.39: OK +DEAL::Cell 2.40: OK +DEAL::Cell 2.41: OK +DEAL::Cell 2.42: OK +DEAL::Cell 2.43: OK +DEAL::Cell 2.44: OK +DEAL::Cell 2.45: OK +DEAL::Cell 2.46: OK +DEAL::Cell 2.47: OK +DEAL::Cell 2.48: OK +DEAL::Cell 2.49: OK +DEAL::Cell 2.50: OK +DEAL::Cell 2.51: OK +DEAL::Cell 2.52: OK +DEAL::Cell 2.53: OK +DEAL::Cell 2.54: OK +DEAL::Cell 2.55: OK +DEAL::Cell 2.56: OK +DEAL::Cell 2.57: OK +DEAL::Cell 2.58: OK +DEAL::Cell 2.59: OK +DEAL::Cell 2.60: OK +DEAL::Cell 2.61: OK +DEAL::Cell 2.62: OK +DEAL::Cell 2.63: OK +DEAL::dim = 2, spacedim = 2 +DEAL::degree = 2 +DEAL::Cell 2.0: OK +DEAL::Cell 2.1: OK +DEAL::Cell 2.2: OK +DEAL::Cell 2.3: OK +DEAL::Cell 2.4: OK +DEAL::Cell 2.5: OK +DEAL::Cell 2.6: OK +DEAL::Cell 2.7: OK +DEAL::Cell 2.8: OK +DEAL::Cell 2.9: OK +DEAL::Cell 2.10: OK +DEAL::Cell 2.11: OK +DEAL::Cell 2.12: OK +DEAL::Cell 2.13: OK +DEAL::Cell 2.14: OK +DEAL::Cell 2.15: OK +DEAL::dim = 2, spacedim = 3 +DEAL::degree = 2 +DEAL::Cell 2.0: OK +DEAL::Cell 2.1: OK +DEAL::Cell 2.2: OK +DEAL::Cell 2.3: OK +DEAL::Cell 2.4: OK +DEAL::Cell 2.5: OK +DEAL::Cell 2.6: OK +DEAL::Cell 2.7: OK +DEAL::Cell 2.8: OK +DEAL::Cell 2.9: OK +DEAL::Cell 2.10: OK +DEAL::Cell 2.11: OK +DEAL::Cell 2.12: OK +DEAL::Cell 2.13: OK +DEAL::Cell 2.14: OK +DEAL::Cell 2.15: OK +DEAL::dim = 3, spacedim = 3 +DEAL::degree = 2 +DEAL::Cell 2.0: OK +DEAL::Cell 2.1: OK +DEAL::Cell 2.2: OK +DEAL::Cell 2.3: OK +DEAL::Cell 2.4: OK +DEAL::Cell 2.5: OK +DEAL::Cell 2.6: OK +DEAL::Cell 2.7: OK +DEAL::Cell 2.8: OK +DEAL::Cell 2.9: OK +DEAL::Cell 2.10: OK +DEAL::Cell 2.11: OK +DEAL::Cell 2.12: OK +DEAL::Cell 2.13: OK +DEAL::Cell 2.14: OK +DEAL::Cell 2.15: OK +DEAL::Cell 2.16: OK +DEAL::Cell 2.17: OK +DEAL::Cell 2.18: OK +DEAL::Cell 2.19: OK +DEAL::Cell 2.20: OK +DEAL::Cell 2.21: OK +DEAL::Cell 2.22: OK +DEAL::Cell 2.23: OK +DEAL::Cell 2.24: OK +DEAL::Cell 2.25: OK +DEAL::Cell 2.26: OK +DEAL::Cell 2.27: OK +DEAL::Cell 2.28: OK +DEAL::Cell 2.29: OK +DEAL::Cell 2.30: OK +DEAL::Cell 2.31: OK +DEAL::Cell 2.32: OK +DEAL::Cell 2.33: OK +DEAL::Cell 2.34: OK +DEAL::Cell 2.35: OK +DEAL::Cell 2.36: OK +DEAL::Cell 2.37: OK +DEAL::Cell 2.38: OK +DEAL::Cell 2.39: OK +DEAL::Cell 2.40: OK +DEAL::Cell 2.41: OK +DEAL::Cell 2.42: OK +DEAL::Cell 2.43: OK +DEAL::Cell 2.44: OK +DEAL::Cell 2.45: OK +DEAL::Cell 2.46: OK +DEAL::Cell 2.47: OK +DEAL::Cell 2.48: OK +DEAL::Cell 2.49: OK +DEAL::Cell 2.50: OK +DEAL::Cell 2.51: OK +DEAL::Cell 2.52: OK +DEAL::Cell 2.53: OK +DEAL::Cell 2.54: OK +DEAL::Cell 2.55: OK +DEAL::Cell 2.56: OK +DEAL::Cell 2.57: OK +DEAL::Cell 2.58: OK +DEAL::Cell 2.59: OK +DEAL::Cell 2.60: OK +DEAL::Cell 2.61: OK +DEAL::Cell 2.62: OK +DEAL::Cell 2.63: OK +DEAL::dim = 2, spacedim = 2 +DEAL::degree = 3 +DEAL::Cell 2.0: OK +DEAL::Cell 2.1: OK +DEAL::Cell 2.2: OK +DEAL::Cell 2.3: OK +DEAL::Cell 2.4: OK +DEAL::Cell 2.5: OK +DEAL::Cell 2.6: OK +DEAL::Cell 2.7: OK +DEAL::Cell 2.8: OK +DEAL::Cell 2.9: OK +DEAL::Cell 2.10: OK +DEAL::Cell 2.11: OK +DEAL::Cell 2.12: OK +DEAL::Cell 2.13: OK +DEAL::Cell 2.14: OK +DEAL::Cell 2.15: OK +DEAL::dim = 2, spacedim = 3 +DEAL::degree = 3 +DEAL::Cell 2.0: OK +DEAL::Cell 2.1: OK +DEAL::Cell 2.2: OK +DEAL::Cell 2.3: OK +DEAL::Cell 2.4: OK +DEAL::Cell 2.5: OK +DEAL::Cell 2.6: OK +DEAL::Cell 2.7: OK +DEAL::Cell 2.8: OK +DEAL::Cell 2.9: OK +DEAL::Cell 2.10: OK +DEAL::Cell 2.11: OK +DEAL::Cell 2.12: OK +DEAL::Cell 2.13: OK +DEAL::Cell 2.14: OK +DEAL::Cell 2.15: OK +DEAL::dim = 3, spacedim = 3 +DEAL::degree = 3 +DEAL::Cell 2.0: OK +DEAL::Cell 2.1: OK +DEAL::Cell 2.2: OK +DEAL::Cell 2.3: OK +DEAL::Cell 2.4: OK +DEAL::Cell 2.5: OK +DEAL::Cell 2.6: OK +DEAL::Cell 2.7: OK +DEAL::Cell 2.8: OK +DEAL::Cell 2.9: OK +DEAL::Cell 2.10: OK +DEAL::Cell 2.11: OK +DEAL::Cell 2.12: OK +DEAL::Cell 2.13: OK +DEAL::Cell 2.14: OK +DEAL::Cell 2.15: OK +DEAL::Cell 2.16: OK +DEAL::Cell 2.17: OK +DEAL::Cell 2.18: OK +DEAL::Cell 2.19: OK +DEAL::Cell 2.20: OK +DEAL::Cell 2.21: OK +DEAL::Cell 2.22: OK +DEAL::Cell 2.23: OK +DEAL::Cell 2.24: OK +DEAL::Cell 2.25: OK +DEAL::Cell 2.26: OK +DEAL::Cell 2.27: OK +DEAL::Cell 2.28: OK +DEAL::Cell 2.29: OK +DEAL::Cell 2.30: OK +DEAL::Cell 2.31: OK +DEAL::Cell 2.32: OK +DEAL::Cell 2.33: OK +DEAL::Cell 2.34: OK +DEAL::Cell 2.35: OK +DEAL::Cell 2.36: OK +DEAL::Cell 2.37: OK +DEAL::Cell 2.38: OK +DEAL::Cell 2.39: OK +DEAL::Cell 2.40: OK +DEAL::Cell 2.41: OK +DEAL::Cell 2.42: OK +DEAL::Cell 2.43: OK +DEAL::Cell 2.44: OK +DEAL::Cell 2.45: OK +DEAL::Cell 2.46: OK +DEAL::Cell 2.47: OK +DEAL::Cell 2.48: OK +DEAL::Cell 2.49: OK +DEAL::Cell 2.50: OK +DEAL::Cell 2.51: OK +DEAL::Cell 2.52: OK +DEAL::Cell 2.53: OK +DEAL::Cell 2.54: OK +DEAL::Cell 2.55: OK +DEAL::Cell 2.56: OK +DEAL::Cell 2.57: OK +DEAL::Cell 2.58: OK +DEAL::Cell 2.59: OK +DEAL::Cell 2.60: OK +DEAL::Cell 2.61: OK +DEAL::Cell 2.62: OK +DEAL::Cell 2.63: OK