From 9c551d0f671842314fdf677283a4519ff10f2a39 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sun, 16 Apr 2017 13:42:49 +0200 Subject: [PATCH] Instantiate MeshWorker objects for dim != spacedim --- doc/news/changes/minor/20170416DanielArndt | 3 ++ include/deal.II/meshworker/dof_info.h | 12 +++--- include/deal.II/meshworker/integration_info.h | 8 ++-- include/deal.II/meshworker/loop.h | 6 +-- include/deal.II/meshworker/vector_selector.h | 16 ++++---- .../meshworker/vector_selector.templates.h | 24 ++++++------ source/meshworker/mesh_worker_info.inst.in | 37 +++++++------------ .../mesh_worker_vector_selector.inst.in | 18 +++++---- 8 files changed, 60 insertions(+), 64 deletions(-) create mode 100644 doc/news/changes/minor/20170416DanielArndt diff --git a/doc/news/changes/minor/20170416DanielArndt b/doc/news/changes/minor/20170416DanielArndt new file mode 100644 index 0000000000..f8b22c68de --- /dev/null +++ b/doc/news/changes/minor/20170416DanielArndt @@ -0,0 +1,3 @@ +Fixed: The MeshWorker framework can also be used in case dim != spacedim. +
+(Daniel Arndt, 2017/04/16) diff --git a/include/deal.II/meshworker/dof_info.h b/include/deal.II/meshworker/dof_info.h index d17372380e..6daf750343 100644 --- a/include/deal.II/meshworker/dof_info.h +++ b/include/deal.II/meshworker/dof_info.h @@ -327,7 +327,7 @@ namespace MeshWorker const DHFaceIterator &f, const unsigned int face_no) { - face = static_cast::face_iterator> (f); + face = static_cast::face_iterator> (f); face_number = face_no; sub_number = numbers::invalid_unsigned_int; } @@ -342,11 +342,11 @@ namespace MeshWorker const unsigned int face_no) { if ((cell.state() != IteratorState::valid) - || cell != typename Triangulation::cell_iterator(*c)) + || cell != typename Triangulation::cell_iterator(*c)) get_indices(c); level_cell = c->is_level_cell(); - cell = typename Triangulation::cell_iterator(*c); + cell = typename Triangulation::cell_iterator(*c); set_face(f,face_no); if (block_info) @@ -364,7 +364,7 @@ namespace MeshWorker const unsigned int face_no, const unsigned int subface_no) { - face = static_cast::face_iterator> (f); + face = static_cast::face_iterator> (f); face_number = face_no; sub_number = subface_no; } @@ -380,11 +380,11 @@ namespace MeshWorker const unsigned int subface_no) { if (cell.state() != IteratorState::valid - || cell != static_cast::cell_iterator> (c)) + || cell != static_cast::cell_iterator> (c)) get_indices(c); level_cell = c->is_level_cell(); - cell = static_cast::cell_iterator> (c); + cell = static_cast::cell_iterator> (c); set_subface(f, face_no, subface_no); if (block_info) diff --git a/include/deal.II/meshworker/integration_info.h b/include/deal.II/meshworker/integration_info.h index c494c1174c..e75848a4ed 100644 --- a/include/deal.II/meshworker/integration_info.h +++ b/include/deal.II/meshworker/integration_info.h @@ -166,7 +166,7 @@ namespace MeshWorker * one vector for each component, containing vectors with values for each * quadrature point. */ - std::vector > > > gradients; + std::vector > > > gradients; /** * The vector containing the second derivatives of finite element @@ -176,7 +176,7 @@ namespace MeshWorker * one vector for each component, containing vectors with values for each * quadrature point. */ - std::vector > > > hessians; + std::vector > > > hessians; /** * Reinitialize internal data structures for use on a cell. @@ -666,13 +666,13 @@ namespace MeshWorker if (info.sub_number != numbers::invalid_unsigned_int) { // This is a subface - FESubfaceValues &fe = dynamic_cast&> (febase); + FESubfaceValues &fe = dynamic_cast&> (febase); fe.reinit(info.cell, info.face_number, info.sub_number); } else if (info.face_number != numbers::invalid_unsigned_int) { // This is a face - FEFaceValues &fe = dynamic_cast&> (febase); + FEFaceValues &fe = dynamic_cast&> (febase); fe.reinit(info.cell, info.face_number); } else diff --git a/include/deal.II/meshworker/loop.h b/include/deal.II/meshworker/loop.h index d062db5dd8..7e025aae40 100644 --- a/include/deal.II/meshworker/loop.h +++ b/include/deal.II/meshworker/loop.h @@ -438,9 +438,9 @@ namespace MeshWorker ASSEMBLER &assembler, const LoopControl &lctrl = LoopControl()) { - std::function&, IntegrationInfo&)> cell_worker; - std::function&, IntegrationInfo&)> boundary_worker; - std::function &, DoFInfo &, + std::function&, IntegrationInfo&)> cell_worker; + std::function&, IntegrationInfo&)> boundary_worker; + std::function&, DoFInfo &, IntegrationInfo &, IntegrationInfo &)> face_worker; if (integrator.use_cell) diff --git a/include/deal.II/meshworker/vector_selector.h b/include/deal.II/meshworker/vector_selector.h index bee6022bf5..1917b9d5f1 100644 --- a/include/deal.II/meshworker/vector_selector.h +++ b/include/deal.II/meshworker/vector_selector.h @@ -241,8 +241,8 @@ namespace MeshWorker */ virtual void fill( std::vector > > &values, - std::vector > > > &gradients, - std::vector > > > &hessians, + std::vector > > > &gradients, + std::vector > > > &hessians, const FEValuesBase &fe, const std::vector &index, const unsigned int component, @@ -258,8 +258,8 @@ namespace MeshWorker */ virtual void mg_fill( std::vector > > &values, - std::vector > > > &gradients, - std::vector > > > &hessians, + std::vector > > > &gradients, + std::vector > > > &hessians, const FEValuesBase &fe, const unsigned int level, const std::vector &index, @@ -315,8 +315,8 @@ namespace MeshWorker virtual void fill( std::vector > > &values, - std::vector > > > &gradients, - std::vector > > > &hessians, + std::vector > > > &gradients, + std::vector > > > &hessians, const FEValuesBase &fe, const std::vector &index, const unsigned int component, @@ -326,8 +326,8 @@ namespace MeshWorker virtual void mg_fill( std::vector > > &values, - std::vector > > > &gradients, - std::vector > > > &hessians, + std::vector > > > &gradients, + std::vector > > > &hessians, const FEValuesBase &fe, const unsigned int level, const std::vector &index, diff --git a/include/deal.II/meshworker/vector_selector.templates.h b/include/deal.II/meshworker/vector_selector.templates.h index 32a393b58b..24c73a8900 100644 --- a/include/deal.II/meshworker/vector_selector.templates.h +++ b/include/deal.II/meshworker/vector_selector.templates.h @@ -55,8 +55,8 @@ namespace MeshWorker void VectorDataBase::fill( std::vector > > &, - std::vector > > > &, - std::vector > > > &, + std::vector > > > &, + std::vector > > > &, const FEValuesBase &, const std::vector &, const unsigned int, @@ -72,8 +72,8 @@ namespace MeshWorker void VectorDataBase::mg_fill( std::vector > > &, - std::vector > > > &, - std::vector > > > &, + std::vector > > > &, + std::vector > > > &, const FEValuesBase &, const unsigned int, const std::vector &, @@ -123,8 +123,8 @@ namespace MeshWorker void VectorData::fill( std::vector > > &values, - std::vector > > > &gradients, - std::vector > > > &hessians, + std::vector > > > &gradients, + std::vector > > > &hessians, const FEValuesBase &fe, const std::vector &index, const unsigned int component, @@ -147,14 +147,14 @@ namespace MeshWorker for (unsigned int i=0; in_gradients(); ++i) { const VectorType *src = data.read_ptr(this->gradient_index(i)); - VectorSlice > > > dst(gradients[i], component, n_comp); + VectorSlice > > > dst(gradients[i], component, n_comp); fe.get_function_gradients(*src, make_slice(index, start, size), dst, true); } for (unsigned int i=0; in_hessians(); ++i) { const VectorType *src = data.read_ptr(this->hessian_index(i)); - VectorSlice > > > dst(hessians[i], component, n_comp); + VectorSlice > > > dst(hessians[i], component, n_comp); fe.get_function_hessians(*src, make_slice(index, start, size), dst, true); } } @@ -207,8 +207,8 @@ namespace MeshWorker void VectorData::mg_fill (std::vector > > &values, - std::vector > > > &gradients, - std::vector > > > &hessians, + std::vector > > > &gradients, + std::vector > > > &hessians, const FEValuesBase &fe, const unsigned int level, const std::vector &index, @@ -233,14 +233,14 @@ namespace MeshWorker for (unsigned int i=0; in_gradients(); ++i) { const MGLevelObject *src = data.read_ptr >(this->value_index(i)); - VectorSlice > > > dst(gradients[i], component, n_comp); + VectorSlice > > > dst(gradients[i], component, n_comp); fe.get_function_gradients((*src)[level], make_slice(index, start, size), dst, true); } for (unsigned int i=0; in_hessians(); ++i) { const MGLevelObject *src = data.read_ptr >(this->value_index(i)); - VectorSlice > > > dst(hessians[i], component, n_comp); + VectorSlice > > > dst(hessians[i], component, n_comp); fe.get_function_hessians((*src)[level], make_slice(index, start, size), dst, true); } } diff --git a/source/meshworker/mesh_worker_info.inst.in b/source/meshworker/mesh_worker_info.inst.in index 20f3cadd8e..8d83c58d2a 100644 --- a/source/meshworker/mesh_worker_info.inst.in +++ b/source/meshworker/mesh_worker_info.inst.in @@ -14,38 +14,27 @@ // --------------------------------------------------------------------- -for (deal_II_dimension : DIMENSIONS) +for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS) { namespace MeshWorker \{ - template class IntegrationInfo; - template class IntegrationInfoBox; +#if deal_II_dimension <= deal_II_space_dimension + template class IntegrationInfo; + template class IntegrationInfoBox; - template class DoFInfo; + template class DoFInfo; template class DoFInfoBox >; + DoFInfo >; - template void IntegrationInfo::fill_local_data( - const DoFInfo&, bool); + template void IntegrationInfo::fill_local_data( + const DoFInfo&, bool); - template class DoFInfo; + template class DoFInfo; template class DoFInfoBox >; + DoFInfo >; - template void IntegrationInfo::fill_local_data( - const DoFInfo&, bool); - -// template void IntegrationInfo -// ::initialize >( -// const FiniteElement&, const Mapping&, -// const Quadrature::integral_dimension>&, const UpdateFlags, const BlockInfo*); -// template void IntegrationInfo -// ::initialize >( -// const FiniteElement&, const Mapping&, -// const Quadrature::integral_dimension>&, const UpdateFlags, const BlockInfo*); -// template void IntegrationInfo -// ::initialize >( -// const FiniteElement&, const Mapping&, -// const Quadrature::integral_dimension>&, const UpdateFlags, const BlockInfo*); + template void IntegrationInfo::fill_local_data( + const DoFInfo&, bool); +#endif \} } diff --git a/source/meshworker/mesh_worker_vector_selector.inst.in b/source/meshworker/mesh_worker_vector_selector.inst.in index 0cbd1e7401..e6490ba128 100644 --- a/source/meshworker/mesh_worker_vector_selector.inst.in +++ b/source/meshworker/mesh_worker_vector_selector.inst.in @@ -15,21 +15,25 @@ -for (deal_II_dimension : DIMENSIONS) +for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS) { namespace MeshWorker \{ - template class VectorDataBase; +#if deal_II_dimension <= deal_II_space_dimension + template class VectorDataBase; +#endif \} } -for (VECTOR : SERIAL_VECTORS ; deal_II_dimension : DIMENSIONS) +for (VECTOR : SERIAL_VECTORS; deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS) { namespace MeshWorker \{ - template class VectorData; - template class VectorData; - template class MGVectorData; - template class MGVectorData; +#if deal_II_dimension <= deal_II_space_dimension + template class VectorData; + template class VectorData; + template class MGVectorData; + template class MGVectorData; +#endif \} } -- 2.39.5