From: Martin Kronbichler Date: Tue, 22 Sep 2015 16:04:22 +0000 (+0200) Subject: Fix orientation of 1D periodic case X-Git-Tag: v8.4.0-rc2~382^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2ea8c4cbba53dfd74a265c11a56460e33f63164;p=dealii.git Fix orientation of 1D periodic case --- diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 96394ba584..dce6a7f6c7 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -2662,7 +2662,7 @@ next_cell: static inline std::bitset<3> lookup (const MATCH_T &) { // The 1D case is trivial - return 4; // [true ,false,false] + return 1; // [true ,false,false] } }; diff --git a/source/grid/grid_tools.inst.in b/source/grid/grid_tools.inst.in index 27ab3513dd..e6a85a1827 100644 --- a/source/grid/grid_tools.inst.in +++ b/source/grid/grid_tools.inst.in @@ -96,7 +96,7 @@ for (deal_II_dimension : DIMENSIONS ; deal_II_space_dimension : SPACE_DIMENSIONS template std::vector >::type> compute_active_cell_halo_layer (const parallel::distributed::Triangulation &, - const std_cxx11::function >::type&)> &); template @@ -311,26 +311,22 @@ for (X : TRIANGULATION_AND_DOFHANDLERS; deal_II_dimension : DIMENSIONS ; deal_II const Tensor<1,deal_II_space_dimension> &, const FullMatrix &); - #if deal_II_dimension >= 2 - - template - void collect_periodic_faces (const X &, - const types::boundary_id, - const types::boundary_id, - const int, - std::vector > &, - const Tensor<1,X::space_dimension> &, - const FullMatrix &); - - template - void collect_periodic_faces (const X &, - const types::boundary_id, - const int, - std::vector > &, - const Tensor<1,X::space_dimension> &, - const FullMatrix &); + template + void collect_periodic_faces (const X &, + const types::boundary_id, + const types::boundary_id, + const int, + std::vector > &, + const Tensor<1,X::space_dimension> &, + const FullMatrix &); - #endif + template + void collect_periodic_faces (const X &, + const types::boundary_id, + const int, + std::vector > &, + const Tensor<1,X::space_dimension> &, + const FullMatrix &); \} #endif @@ -379,4 +375,3 @@ for (deal_II_dimension : DIMENSIONS ; deal_II_space_dimension : SPACE_DIMENSIONS \} #endif } - diff --git a/tests/grid/periodicity_1d.cc b/tests/grid/periodicity_1d.cc new file mode 100644 index 0000000000..3806b84a74 --- /dev/null +++ b/tests/grid/periodicity_1d.cc @@ -0,0 +1,70 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2007 - 2015 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 at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- + + + +// Check periodic boundary faces + +#include "../tests.h" +#include +#include + +#include +#include + +#include +#include + + + +template +void check() +{ + Triangulation tr; + Point p0, p1; + for (unsigned int d=0; d refinements(dim, 3); + GridGenerator::subdivided_hyper_rectangle(tr, refinements, p0, p1, true); + tr.refine_global(4-dim); + + std::vector::cell_iterator> > periodic_faces; + for (unsigned int d=0; dindex() << " " + << periodic_faces[i].cell[1]->index() << " " + << periodic_faces[i].face_idx[0] << " " + << periodic_faces[i].face_idx[1] << " " + << periodic_faces[i].orientation + << std::endl; + } +} + + +int main() +{ + std::ofstream logfile("output"); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + check<1>(); + check<2>(); + check<3>(); +} diff --git a/tests/grid/periodicity_1d.output b/tests/grid/periodicity_1d.output new file mode 100644 index 0000000000..7f620fca4b --- /dev/null +++ b/tests/grid/periodicity_1d.output @@ -0,0 +1,38 @@ + +DEAL::Test run in 1 dimensions +DEAL::0 2 0 1 001 +DEAL::Test run in 2 dimensions +DEAL::0 2 0 1 001 +DEAL::3 5 0 1 001 +DEAL::6 8 0 1 001 +DEAL::0 6 2 3 001 +DEAL::1 7 2 3 001 +DEAL::2 8 2 3 001 +DEAL::Test run in 3 dimensions +DEAL::0 2 0 1 001 +DEAL::3 5 0 1 001 +DEAL::6 8 0 1 001 +DEAL::9 11 0 1 001 +DEAL::12 14 0 1 001 +DEAL::15 17 0 1 001 +DEAL::18 20 0 1 001 +DEAL::21 23 0 1 001 +DEAL::24 26 0 1 001 +DEAL::0 6 2 3 001 +DEAL::1 7 2 3 001 +DEAL::2 8 2 3 001 +DEAL::9 15 2 3 001 +DEAL::10 16 2 3 001 +DEAL::11 17 2 3 001 +DEAL::18 24 2 3 001 +DEAL::19 25 2 3 001 +DEAL::20 26 2 3 001 +DEAL::0 18 4 5 001 +DEAL::1 19 4 5 001 +DEAL::2 20 4 5 001 +DEAL::3 21 4 5 001 +DEAL::4 22 4 5 001 +DEAL::5 23 4 5 001 +DEAL::6 24 4 5 001 +DEAL::7 25 4 5 001 +DEAL::8 26 4 5 001