From 4c80fa8ad291a0924e40333e1eb419294eac6fd2 Mon Sep 17 00:00:00 2001 From: maier Date: Tue, 1 Oct 2013 21:35:48 +0000 Subject: [PATCH] Port the distributed periodicity test, add missing template instantiation git-svn-id: https://svn.dealii.org/trunk@31064 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/grid/grid_tools.h | 4 ++-- deal.II/source/grid/grid_tools.inst.in | 29 +++++++++++++++++++++++ tests/mpi/periodicity_01.cc | 18 +++++--------- 3 files changed, 37 insertions(+), 14 deletions(-) diff --git a/deal.II/include/deal.II/grid/grid_tools.h b/deal.II/include/deal.II/grid/grid_tools.h index ac6080e565..68051ef871 100644 --- a/deal.II/include/deal.II/grid/grid_tools.h +++ b/deal.II/include/deal.II/grid/grid_tools.h @@ -1103,7 +1103,7 @@ namespace GridTools const types::boundary_id b_id1, const types::boundary_id b_id2, const int direction, - const dealii::Tensor<1,DH::space_dimension> &offset); + const dealii::Tensor<1,DH::space_dimension> &offset = dealii::Tensor<1,DH::space_dimension>()); /** @@ -1132,7 +1132,7 @@ namespace GridTools (const DH &dof_handler, const types::boundary_id b_id, const int direction, - const dealii::Tensor<1,DH::space_dimension> &offset); + const dealii::Tensor<1,DH::space_dimension> &offset = dealii::Tensor<1,DH::space_dimension>()); /** diff --git a/deal.II/source/grid/grid_tools.inst.in b/deal.II/source/grid/grid_tools.inst.in index 6f4d0f0d6e..58602fe7cd 100644 --- a/deal.II/source/grid/grid_tools.inst.in +++ b/deal.II/source/grid/grid_tools.inst.in @@ -274,3 +274,32 @@ for (X : TRIANGULATION_AND_DOFHANDLERS; deal_II_dimension : DIMENSIONS ; deal_II #endif } +for (deal_II_dimension : DIMENSIONS ; deal_II_space_dimension : SPACE_DIMENSIONS) +{ +#if deal_II_dimension <= deal_II_space_dimension + #if deal_II_dimension >= 2 + + namespace GridTools \{ + + template + std::vector::cell_iterator> > + collect_periodic_faces > + (const parallel::distributed::Triangulation &, + const types::boundary_id, + const types::boundary_id, + const int, + const Tensor<1,parallel::distributed::Triangulation::space_dimension> &); + + template + std::vector::cell_iterator> > + collect_periodic_faces > + (const parallel::distributed::Triangulation &, + const types::boundary_id, + const int, + const Tensor<1,parallel::distributed::Triangulation::space_dimension> &); + + \} + #endif +#endif +} + diff --git a/tests/mpi/periodicity_01.cc b/tests/mpi/periodicity_01.cc index 04e7137ea1..91d2f2dac1 100644 --- a/tests/mpi/periodicity_01.cc +++ b/tests/mpi/periodicity_01.cc @@ -480,20 +480,14 @@ namespace Step40 GridGenerator::subdivided_hyper_rectangle (triangulation,reps,p1,p2,true); - std::vector - ::cell_iterator, unsigned int, - typename parallel::distributed::Triangulation::cell_iterator, unsigned int> > - periodicity_vector; for(int i=1; i::cell_iterator> > + periodicity_vector = GridTools::collect_periodic_faces + ( triangulation, /*b_id1*/ 2*i, /*b_id2*/ 2*i+1, /*direction*/ i); + triangulation.add_periodicity(periodicity_vector); + } triangulation.refine_global (1); } else -- 2.39.5