From: kanschat Date: Sun, 28 Mar 2010 19:49:36 +0000 (+0000) Subject: make DOFINFO a template argument of MeshWorker::loop X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=852d9e0f070fed9cec158131e2cfc8828bbd86fc;p=dealii-svn.git make DOFINFO a template argument of MeshWorker::loop git-svn-id: https://svn.dealii.org/trunk@20904 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/numerics/mesh_worker_info.h b/deal.II/deal.II/include/numerics/mesh_worker_info.h index 5ccd0a3f61..d141bbb210 100644 --- a/deal.II/deal.II/include/numerics/mesh_worker_info.h +++ b/deal.II/deal.II/include/numerics/mesh_worker_info.h @@ -24,6 +24,8 @@ DEAL_II_NAMESPACE_OPEN namespace MeshWorker { + template class DoFInfoBox; + /** * The class providing the scrapbook to fill with local integration * results. These can be values, local contributions to forms or cell @@ -230,7 +232,7 @@ namespace MeshWorker std::vector > quadrature_values; }; - template class DoFInfoBox; + template class DoFInfoBox; /** * A class containing information on geometry and degrees of freedom @@ -271,10 +273,10 @@ namespace MeshWorker { public: /// The current cell - typename Triangulation::cell_iterator cell; + typename Triangulation::cell_iterator cell; /// The current face - typename Triangulation::face_iterator face; + typename Triangulation::face_iterator face; /** * The number of the current @@ -383,7 +385,7 @@ namespace MeshWorker */ BlockIndices aux_local_indices; - friend class DoFInfoBox; + friend class DoFInfoBox >; }; @@ -395,9 +397,10 @@ namespace MeshWorker * itself in one object, saving a bit of memory and a few operations, * but sacrificing some cleanliness. * + * @ingroup MeshWorker * @author Guido Kanschat, 2010 */ - template + template class DoFInfoBox { public: @@ -405,14 +408,14 @@ namespace MeshWorker * Constructor copying the seed * into all other objects. */ - DoFInfoBox(const DoFInfo& seed); + DoFInfoBox(const DOFINFO& seed); /** * Copy constructor, taking * #cell and using it as a seed * in the other constructor. */ - DoFInfoBox(const DoFInfoBox&); + DoFInfoBox(const DoFInfoBox&); /** * Reset all the availability flags. @@ -435,15 +438,15 @@ namespace MeshWorker /** * The data for the cell. */ - DoFInfo cell; + DOFINFO cell; /** * The data for the faces from inside. */ - DoFInfo interior[GeometryInfo::faces_per_cell]; + DOFINFO interior[GeometryInfo::faces_per_cell]; /** * The data for the faces from outside. */ - DoFInfo exterior[GeometryInfo::faces_per_cell]; + DOFINFO exterior[GeometryInfo::faces_per_cell]; /** * A set of flags, indicating @@ -1080,9 +1083,9 @@ namespace MeshWorker //----------------------------------------------------------------------// - template < int dim, int spacedim> + template inline - DoFInfoBox::DoFInfoBox(const DoFInfo& seed) + DoFInfoBox::DoFInfoBox(const DOFINFO& seed) : cell(seed) { @@ -1096,9 +1099,9 @@ namespace MeshWorker } - template < int dim, int spacedim> + template inline - DoFInfoBox::DoFInfoBox(const DoFInfoBox& other) + DoFInfoBox::DoFInfoBox(const DoFInfoBox& other) : cell(other.cell) { @@ -1112,9 +1115,9 @@ namespace MeshWorker } - template < int dim, int spacedim> + template inline void - DoFInfoBox::reset () + DoFInfoBox::reset () { for (unsigned int i=0;i::faces_per_cell;++i) { @@ -1124,10 +1127,10 @@ namespace MeshWorker } - template < int dim, int spacedim> + template template inline void - DoFInfoBox::assemble (ASSEMBLER& assembler) const + DoFInfoBox::assemble (ASSEMBLER& assembler) const { assembler.assemble(cell); for (unsigned int i=0;i::faces_per_cell;++i) diff --git a/deal.II/deal.II/include/numerics/mesh_worker_loop.h b/deal.II/deal.II/include/numerics/mesh_worker_loop.h index a423fc2af6..24f60454ee 100644 --- a/deal.II/deal.II/include/numerics/mesh_worker_loop.h +++ b/deal.II/deal.II/include/numerics/mesh_worker_loop.h @@ -42,8 +42,8 @@ namespace internal return true; } - template - void assemble(const MeshWorker::DoFInfoBox& dinfo, A& assembler) + template + void assemble(const MeshWorker::DoFInfoBox& dinfo, A& assembler) { dinfo.assemble(assembler); } @@ -85,10 +85,10 @@ namespace MeshWorker * * @author Guido Kanschat, 2010 */ - template + template void cell_action( ITERATOR cell, - DoFInfoBox& dof_info, + DoFInfoBox& dof_info, INFOBOX& info, const std_cxx1x::function&, typename INFOBOX::CellInfo &)> &cell_worker, const std_cxx1x::function&, typename INFOBOX::FaceInfo &)> &boundary_worker, @@ -230,10 +230,10 @@ namespace MeshWorker * @ingroup MeshWorker * @author Guido Kanschat, 2009 */ - template + template void loop(ITERATOR begin, typename identity::type end, - DoFInfo dinfo, + DOFINFO& dinfo, INFOBOX& info, const std_cxx1x::function&, typename INFOBOX::CellInfo &)> &cell_worker, const std_cxx1x::function&, typename INFOBOX::FaceInfo &)> &boundary_worker, @@ -243,7 +243,7 @@ namespace MeshWorker ASSEMBLER &assembler, bool cells_first = true) { - DoFInfoBox dof_info(dinfo); + DoFInfoBox dof_info(dinfo); assembler.initialize_info(dof_info.cell, false); for (unsigned int i=0;i::faces_per_cell;++i) @@ -272,10 +272,10 @@ namespace MeshWorker * @ingroup MeshWorker * @author Guido Kanschat, 2009 */ - template + template void integration_loop(ITERATOR begin, typename identity::type end, - DoFInfo& dof_info, + DOFINFO& dof_info, IntegrationInfoBox& box, const std_cxx1x::function&, CELLINFO &)> &cell_worker, const std_cxx1x::function&, FACEINFO &)> &boundary_worker, @@ -283,7 +283,7 @@ namespace MeshWorker ASSEMBLER &assembler, bool cells_first = true) { - loop,IntegrationInfoBox > + loop, IntegrationInfoBox > (begin, end, dof_info, box, diff --git a/deal.II/deal.II/source/numerics/mesh_worker_info.cc b/deal.II/deal.II/source/numerics/mesh_worker_info.cc index 83c742746f..c70e915fe4 100644 --- a/deal.II/deal.II/source/numerics/mesh_worker_info.cc +++ b/deal.II/deal.II/source/numerics/mesh_worker_info.cc @@ -30,11 +30,17 @@ namespace MeshWorker template class LocalResults; template class DoFInfo; + template class DoFInfoBox >; + template void IntegrationInfo::fill_local_data( const DoFInfo&, bool); template class LocalResults; template class DoFInfo; + template class DoFInfoBox >; + template void IntegrationInfo::fill_local_data( const DoFInfo&, bool);