From b30814fda2ca4ad0066d471facd29e3fd38c1050 Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 12 May 2003 16:05:57 +0000 Subject: [PATCH] Cleanup somewhat. git-svn-id: https://svn.dealii.org/trunk@7628 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/multigrid/mg_tools.templates.h | 133 ++++++++++-------- .../deal.II/include/multigrid/mg_transfer.h | 54 +++---- deal.II/deal.II/include/multigrid/multigrid.h | 1 + .../include/multigrid/multigrid.templates.h | 13 +- 4 files changed, 111 insertions(+), 90 deletions(-) diff --git a/deal.II/deal.II/include/multigrid/mg_tools.templates.h b/deal.II/deal.II/include/multigrid/mg_tools.templates.h index 184784d090..28c0a54b62 100644 --- a/deal.II/deal.II/include/multigrid/mg_tools.templates.h +++ b/deal.II/deal.II/include/multigrid/mg_tools.templates.h @@ -24,6 +24,10 @@ #include + +/* --------------------- MGTransferPrebuilt -------------- */ + + //TODO[GK]: this file must really be changed: it contains #if's for deal_II_dimension, but we can't use this in headers, since application programs might not use this way to select the dimension. the only way in header files is to have proper template specializations @@ -84,7 +88,7 @@ MGTransferPrebuilt::copy_to_mg ( // the respective vector on the // next finer level, which we then // already have built. - for (int level=maxlevel; level>=static_cast(minlevel); --level) + for (int level=maxlevel; level>=static_cast(minlevel); --level) { typename MGDoFHandler::active_cell_iterator level_cell = mg_dof_handler.begin_active(level); @@ -148,10 +152,10 @@ MGTransferPrebuilt::copy_to_mg ( template template void -MGTransferPrebuilt::copy_from_mg( - const MGDoFHandler& mg_dof_handler, - OutVector &dst, - const MGLevelObject > &src) const +MGTransferPrebuilt:: +copy_from_mg(const MGDoFHandler &mg_dof_handler, + OutVector &dst, + const MGLevelObject > &src) const { const unsigned int dofs_per_cell = mg_dof_handler.get_fe().dofs_per_cell; @@ -167,8 +171,8 @@ MGTransferPrebuilt::copy_from_mg( // data appropriately to the output // vector - // Is the level monotonuosly increasing? - + // Note that the level is + // monotonuosly increasing for (; level_cell != endc; ++level_cell) { DoFObjectAccessor& global_cell = *level_cell; @@ -191,13 +195,15 @@ MGTransferPrebuilt::copy_from_mg( //TODO:[GK] constraints->set_zero(dst); } + + template template void -MGTransferPrebuilt::copy_from_mg_add( - const MGDoFHandler& mg_dof_handler, - OutVector &dst, - const MGLevelObject > &src) const +MGTransferPrebuilt:: +copy_from_mg_add (const MGDoFHandler &mg_dof_handler, + OutVector &dst, + const MGLevelObject > &src) const { const unsigned int dofs_per_cell = mg_dof_handler.get_fe().dofs_per_cell; @@ -213,8 +219,8 @@ MGTransferPrebuilt::copy_from_mg_add( // data appropriately to the output // vector - // Is the level monotonuosly increasing? - + // Note that the level is + // monotonuosly increasing for (; level_cell != endc; ++level_cell) { DoFObjectAccessor& global_cell = *level_cell; @@ -240,16 +246,20 @@ MGTransferPrebuilt::copy_from_mg_add( } + +/* --------------------- MGTransferSelect -------------- */ + + //TODO:[?] This function needs to be specially implemented, since in 2d mode we use faces #if deal_II_dimension == 1 template template void -MGTransferSelect::copy_to_mg ( - const MGDoFHandler&, - MGLevelObject >&, - const InVector&) const +MGTransferSelect:: +copy_to_mg (const MGDoFHandler &, + MGLevelObject > &, + const InVector &) const { Assert(false, ExcNotImplemented()); } @@ -260,10 +270,10 @@ MGTransferSelect::copy_to_mg ( template template void -MGTransferSelect::copy_to_mg ( - const MGDoFHandler& mg_dof_handler, - MGLevelObject >& dst, - const InVector& osrc) const +MGTransferSelect:: +copy_to_mg (const MGDoFHandler &mg_dof_handler, + MGLevelObject > &dst, + const InVector &osrc) const { // Make src a real finite element function InVector src = osrc; @@ -303,7 +313,7 @@ MGTransferSelect::copy_to_mg ( // the respective vector on the // next finer level, which we then // already have built. - for (int level=maxlevel; level>=static_cast(minlevel); --level) + for (int level=maxlevel; level>=static_cast(minlevel); --level) { // Start of treated component // for this level @@ -375,10 +385,10 @@ MGTransferSelect::copy_to_mg ( template template void -MGTransferSelect::copy_from_mg( - const MGDoFHandler& mg_dof_handler, - OutVector &dst, - const MGLevelObject > &src) const +MGTransferSelect:: +copy_from_mg (const MGDoFHandler &mg_dof_handler, + OutVector &dst, + const MGLevelObject > &src) const { const FiniteElement& fe = mg_dof_handler.get_fe(); @@ -400,8 +410,8 @@ MGTransferSelect::copy_from_mg( // data appropriately to the output // vector - // Is the level monotonuosly increasing? - + // Note that the level is + // monotonuosly increasing for (; level_cell != endc; ++level_cell) { DoFObjectAccessor& global_cell = *level_cell; @@ -430,13 +440,15 @@ MGTransferSelect::copy_from_mg( //TODO:[GK] constraints->set_zero(dst); } + + template template void -MGTransferSelect::copy_from_mg_add( - const MGDoFHandler& mg_dof_handler, - OutVector &dst, - const MGLevelObject > &src) const +MGTransferSelect:: +copy_from_mg_add (const MGDoFHandler &mg_dof_handler, + OutVector &dst, + const MGLevelObject > &src) const { const FiniteElement& fe = mg_dof_handler.get_fe(); @@ -458,8 +470,8 @@ MGTransferSelect::copy_from_mg_add( // data appropriately to the output // vector - // Is the level monotonuosly increasing? - + // Note that the level is + // monotonuosly increasing for (; level_cell != endc; ++level_cell) { DoFObjectAccessor& global_cell = *level_cell; @@ -491,15 +503,19 @@ MGTransferSelect::copy_from_mg_add( } + +/* --------------------- MGTransferBlock -------------- */ + + #if deal_II_dimension == 1 template template void -MGTransferBlock::copy_to_mg ( - const MGDoFHandler&, - MGLevelObject >&, - const InVector&) const +MGTransferBlock:: +copy_to_mg (const MGDoFHandler &, + MGLevelObject > &, + const InVector &) const { Assert(false, ExcNotImplemented()); } @@ -510,12 +526,13 @@ MGTransferBlock::copy_to_mg ( template template void -MGTransferBlock::copy_to_mg ( - const MGDoFHandler& mg_dof_handler, - MGLevelObject >& dst, - const InVector& src) const +MGTransferBlock:: +copy_to_mg (const MGDoFHandler &mg_dof_handler, + MGLevelObject > &dst, + const InVector &src) const { - // Make src a real finite element function + // Make src a real finite element + // function // InVector src = osrc; // constraints->distribute(src); @@ -530,7 +547,7 @@ MGTransferBlock::copy_to_mg ( dst.clear(); -//TODO:[GK] Make sure dst is not too large ans sizes is filled +//TODO:[GK] Make sure dst is not too large and sizes is filled for (unsigned int l=minlevel;l<=maxlevel;++l) dst[l].reinit(sizes[l]); @@ -548,7 +565,7 @@ MGTransferBlock::copy_to_mg ( // the respective vector on the // next finer level, which we then // already have built. - for (int level=maxlevel; level>=static_cast(minlevel); --level) + for (int level=maxlevel; level>=static_cast(minlevel); --level) { typename MGDoFHandler::active_cell_iterator level_cell = mg_dof_handler.begin_active(level); @@ -596,10 +613,10 @@ MGTransferBlock::copy_to_mg ( template template void -MGTransferBlock::copy_from_mg( - const MGDoFHandler& mg_dof_handler, - OutVector &dst, - const MGLevelObject > &src) const +MGTransferBlock:: +copy_from_mg (const MGDoFHandler &mg_dof_handler, + OutVector &dst, + const MGLevelObject > &src) const { const FiniteElement& fe = mg_dof_handler.get_fe(); @@ -616,8 +633,8 @@ MGTransferBlock::copy_from_mg( // data appropriately to the output // vector - // Is the level monotonuosly increasing? - + // Note that level is monotonuosly + // increasing for (; level_cell != endc; ++level_cell) { DoFObjectAccessor& global_cell = *level_cell; @@ -638,15 +655,16 @@ MGTransferBlock::copy_from_mg( } } + + template template void -MGTransferBlock::copy_from_mg_add( - const MGDoFHandler& mg_dof_handler, - OutVector &dst, - const MGLevelObject > &src) const +MGTransferBlock:: +copy_from_mg_add (const MGDoFHandler &mg_dof_handler, + OutVector &dst, + const MGLevelObject > &src) const { - const FiniteElement& fe = mg_dof_handler.get_fe(); const unsigned int dofs_per_cell = fe.dofs_per_cell; @@ -662,7 +680,8 @@ MGTransferBlock::copy_from_mg_add( // data appropriately to the output // vector - // Is the level monotonuosly increasing? + // Note that the level monotonuosly + // increasing for (; level_cell != endc; ++level_cell) { DoFObjectAccessor& global_cell = *level_cell; diff --git a/deal.II/deal.II/include/multigrid/mg_transfer.h b/deal.II/deal.II/include/multigrid/mg_transfer.h index 00addb9200..c4588bf895 100644 --- a/deal.II/deal.II/include/multigrid/mg_transfer.h +++ b/deal.II/deal.II/include/multigrid/mg_transfer.h @@ -110,9 +110,9 @@ class MGTransferPrebuilt : public MGTransferBase > */ template void - copy_to_mg (const MGDoFHandler& mg_dof, + copy_to_mg (const MGDoFHandler &mg_dof, MGLevelObject > &dst, - const InVector &src) const; + const InVector &src) const; /** * Transfer from multi-level vector to @@ -128,8 +128,8 @@ class MGTransferPrebuilt : public MGTransferBase > */ template void - copy_from_mg (const MGDoFHandler& mg_dof, - OutVector &dst, + copy_from_mg (const MGDoFHandler &mg_dof, + OutVector &dst, const MGLevelObject > &src) const; /** @@ -142,8 +142,8 @@ class MGTransferPrebuilt : public MGTransferBase > */ template void - copy_from_mg_add (const MGDoFHandler& mg_dof, - OutVector &dst, + copy_from_mg_add (const MGDoFHandler &mg_dof, + OutVector &dst, const MGLevelObject > &src) const; /** @@ -201,7 +201,8 @@ class MGTransferPrebuilt : public MGTransferBase > /** - * Implementation of matrix generation for @ref{MGTransferBlock} and @p{MGTransferSelected}. + * Implementation of matrix generation for @ref{MGTransferBlock} and + * @p{MGTransferSelected}. * * @author Guido Kanschat, 2001 */ @@ -375,9 +376,9 @@ class MGTransferBlock : public MGTransferBase >, */ template void - copy_to_mg (const MGDoFHandler& mg_dof, - MGLevelObject >& dst, - const InVector& src) const; + copy_to_mg (const MGDoFHandler &mg_dof, + MGLevelObject > &dst, + const InVector &src) const; /** * Transfer from multi-level vector to @@ -393,9 +394,9 @@ class MGTransferBlock : public MGTransferBase >, */ template void - copy_from_mg (const MGDoFHandler& mg_dof, - OutVector& dst, - const MGLevelObject >& src) const; + copy_from_mg (const MGDoFHandler &mg_dof, + OutVector &dst, + const MGLevelObject > &src) const; /** * Add a multi-level vector to a @@ -407,9 +408,9 @@ class MGTransferBlock : public MGTransferBase >, */ template void - copy_from_mg_add (const MGDoFHandler& mg_dof, - OutVector& dst, - const MGLevelObject >& src) const; + copy_from_mg_add (const MGDoFHandler &mg_dof, + OutVector &dst, + const MGLevelObject > &src) const; }; @@ -501,9 +502,9 @@ class MGTransferSelect : public MGTransferBase >, */ template void - copy_to_mg (const MGDoFHandler& mg_dof, + copy_to_mg (const MGDoFHandler &mg_dof, MGLevelObject > &dst, - const InVector &src) const; + const InVector &src) const; /** * Transfer from multi-level vector to @@ -519,8 +520,8 @@ class MGTransferSelect : public MGTransferBase >, */ template void - copy_from_mg (const MGDoFHandler& mg_dof, - OutVector &dst, + copy_from_mg (const MGDoFHandler &mg_dof, + OutVector &dst, const MGLevelObject > &src) const; /** @@ -533,16 +534,15 @@ class MGTransferSelect : public MGTransferBase >, */ template void - copy_from_mg_add (const MGDoFHandler& mg_dof, - OutVector &dst, + copy_from_mg_add (const MGDoFHandler &mg_dof, + OutVector &dst, const MGLevelObject > &src) const; private: - - /** - * Selected component. - */ - unsigned int selected; + /** + * Selected component. + */ + unsigned int selected; }; diff --git a/deal.II/deal.II/include/multigrid/multigrid.h b/deal.II/deal.II/include/multigrid/multigrid.h index 9a21298999..a227d12520 100644 --- a/deal.II/deal.II/include/multigrid/multigrid.h +++ b/deal.II/deal.II/include/multigrid/multigrid.h @@ -238,6 +238,7 @@ class Multigrid : public Subscriptor * needed for @p{MG_DEBUG} * defined. */ +//TODO[GK]: This won't fly either: deal_II_dimension can't be used in header files #ifdef MG_DEBUG SmartPointer > mg_dof_handler; #endif diff --git a/deal.II/deal.II/include/multigrid/multigrid.templates.h b/deal.II/deal.II/include/multigrid/multigrid.templates.h index e235a3a135..81a7de7290 100644 --- a/deal.II/deal.II/include/multigrid/multigrid.templates.h +++ b/deal.II/deal.II/include/multigrid/multigrid.templates.h @@ -15,12 +15,13 @@ #include #ifdef MG_DEBUG -#include -#include -#include -#include -#include -#include +# include +# include +# include +# include +# include + +# include #endif -- 2.39.5