]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Cleanup somewhat.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 12 May 2003 16:05:57 +0000 (16:05 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 12 May 2003 16:05:57 +0000 (16:05 +0000)
git-svn-id: https://svn.dealii.org/trunk@7628 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/multigrid/mg_tools.templates.h
deal.II/deal.II/include/multigrid/mg_transfer.h
deal.II/deal.II/include/multigrid/multigrid.h
deal.II/deal.II/include/multigrid/multigrid.templates.h

index 184784d090b0926224cc16750af6ed7db7db16fa..28c0a54b629af31fb963519b7f5e4c1475378143 100644 (file)
 #include <fstream>
 
 
+
+/* --------------------- 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<number>::copy_to_mg (
                                   // the respective vector on the
                                   // next finer level, which we then
                                   // already have built.
-  for (int level=maxlevel; level>=static_cast<int>(minlevel); --level)
+  for (int level=maxlevel; level>=static_cast<signed int>(minlevel); --level)
     {
       typename MGDoFHandler<dim>::active_cell_iterator
        level_cell = mg_dof_handler.begin_active(level);
@@ -148,10 +152,10 @@ MGTransferPrebuilt<number>::copy_to_mg (
 template <typename number>
 template <int dim, class OutVector>
 void
-MGTransferPrebuilt<number>::copy_from_mg(
-  const MGDoFHandler<dim>& mg_dof_handler,
-  OutVector &dst,
-  const MGLevelObject<Vector<number> > &src) const
+MGTransferPrebuilt<number>::
+copy_from_mg(const MGDoFHandler<dim>              &mg_dof_handler,
+             OutVector                            &dst,
+             const MGLevelObject<Vector<number> > &src) const
 {
   const unsigned int dofs_per_cell = mg_dof_handler.get_fe().dofs_per_cell;
 
@@ -167,8 +171,8 @@ MGTransferPrebuilt<number>::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<dim, dim>& global_cell = *level_cell;
@@ -191,13 +195,15 @@ MGTransferPrebuilt<number>::copy_from_mg(
 //TODO:[GK]  constraints->set_zero(dst);
 }
 
+
+
 template <typename number>
 template <int dim, class OutVector>
 void
-MGTransferPrebuilt<number>::copy_from_mg_add(
-  const MGDoFHandler<dim>& mg_dof_handler,
-  OutVector &dst,
-  const MGLevelObject<Vector<number> > &src) const
+MGTransferPrebuilt<number>::
+copy_from_mg_add (const MGDoFHandler<dim>              &mg_dof_handler,
+                  OutVector                            &dst,
+                  const MGLevelObject<Vector<number> > &src) const
 {
   const unsigned int dofs_per_cell = mg_dof_handler.get_fe().dofs_per_cell;
 
@@ -213,8 +219,8 @@ MGTransferPrebuilt<number>::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<dim, dim>& global_cell = *level_cell;
@@ -240,16 +246,20 @@ MGTransferPrebuilt<number>::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 <typename number>
 template <int dim, class InVector>
 void
-MGTransferSelect<number>::copy_to_mg (
-  const MGDoFHandler<dim>&,
-  MGLevelObject<Vector<number> >&,
-  const InVector&) const
+MGTransferSelect<number>::
+copy_to_mg (const MGDoFHandler<dim>        &,
+            MGLevelObject<Vector<number> > &,
+            const InVector                 &) const
 {
   Assert(false, ExcNotImplemented());
 }
@@ -260,10 +270,10 @@ MGTransferSelect<number>::copy_to_mg (
 template <typename number>
 template <int dim, class InVector>
 void
-MGTransferSelect<number>::copy_to_mg (
-  const MGDoFHandler<dim>& mg_dof_handler,
-  MGLevelObject<Vector<number> >& dst,
-  const InVector& osrc) const
+MGTransferSelect<number>::
+copy_to_mg (const MGDoFHandler<dim>        &mg_dof_handler,
+            MGLevelObject<Vector<number> > &dst,
+            const InVector                 &osrc) const
 {
                                   // Make src a real finite element function
   InVector src = osrc;
@@ -303,7 +313,7 @@ MGTransferSelect<number>::copy_to_mg (
                                   // the respective vector on the
                                   // next finer level, which we then
                                   // already have built.
-  for (int level=maxlevel; level>=static_cast<int>(minlevel); --level)
+  for (int level=maxlevel; level>=static_cast<signed int>(minlevel); --level)
     {
                                       // Start of treated component
                                       // for this level
@@ -375,10 +385,10 @@ MGTransferSelect<number>::copy_to_mg (
 template <typename number>
 template <int dim, class OutVector>
 void
-MGTransferSelect<number>::copy_from_mg(
-  const MGDoFHandler<dim>& mg_dof_handler,
-  OutVector &dst,
-  const MGLevelObject<Vector<number> > &src) const
+MGTransferSelect<number>::
+copy_from_mg (const MGDoFHandler<dim>              &mg_dof_handler,
+              OutVector                            &dst,
+              const MGLevelObject<Vector<number> > &src) const
 {
 
   const FiniteElement<dim>& fe = mg_dof_handler.get_fe();
@@ -400,8 +410,8 @@ MGTransferSelect<number>::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<dim, dim>& global_cell = *level_cell;
@@ -430,13 +440,15 @@ MGTransferSelect<number>::copy_from_mg(
 //TODO:[GK]  constraints->set_zero(dst);
 }
 
+
+
 template <typename number>
 template <int dim, class OutVector>
 void
-MGTransferSelect<number>::copy_from_mg_add(
-  const MGDoFHandler<dim>& mg_dof_handler,
-  OutVector &dst,
-  const MGLevelObject<Vector<number> > &src) const
+MGTransferSelect<number>::
+copy_from_mg_add (const MGDoFHandler<dim>              &mg_dof_handler,
+                  OutVector                            &dst,
+                  const MGLevelObject<Vector<number> > &src) const
 {
 
   const FiniteElement<dim>& fe = mg_dof_handler.get_fe();
@@ -458,8 +470,8 @@ MGTransferSelect<number>::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<dim, dim>& global_cell = *level_cell;
@@ -491,15 +503,19 @@ MGTransferSelect<number>::copy_from_mg_add(
 }
 
 
+
+/* --------------------- MGTransferBlock -------------- */
+
+
 #if deal_II_dimension == 1
 
 template <typename number>
 template <int dim, class InVector>
 void
-MGTransferBlock<number>::copy_to_mg (
-  const MGDoFHandler<dim>&,
-  MGLevelObject<BlockVector<number> >&,
-  const InVector&) const
+MGTransferBlock<number>::
+copy_to_mg (const MGDoFHandler<dim>             &,
+            MGLevelObject<BlockVector<number> > &,
+            const InVector                      &) const
 {
   Assert(false, ExcNotImplemented());
 }
@@ -510,12 +526,13 @@ MGTransferBlock<number>::copy_to_mg (
 template <typename number>
 template <int dim, class InVector>
 void
-MGTransferBlock<number>::copy_to_mg (
-  const MGDoFHandler<dim>& mg_dof_handler,
-  MGLevelObject<BlockVector<number> >& dst,
-  const InVector& src) const
+MGTransferBlock<number>::
+copy_to_mg (const MGDoFHandler<dim>             &mg_dof_handler,
+            MGLevelObject<BlockVector<number> > &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<number>::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<number>::copy_to_mg (
                                   // the respective vector on the
                                   // next finer level, which we then
                                   // already have built.
-  for (int level=maxlevel; level>=static_cast<int>(minlevel); --level)
+  for (int level=maxlevel; level>=static_cast<signed int>(minlevel); --level)
     {
       typename MGDoFHandler<dim>::active_cell_iterator
        level_cell = mg_dof_handler.begin_active(level);
@@ -596,10 +613,10 @@ MGTransferBlock<number>::copy_to_mg (
 template <typename number>
 template <int dim, class OutVector>
 void
-MGTransferBlock<number>::copy_from_mg(
-  const MGDoFHandler<dim>& mg_dof_handler,
-  OutVector &dst,
-  const MGLevelObject<BlockVector<number> > &src) const
+MGTransferBlock<number>::
+copy_from_mg (const MGDoFHandler<dim>                   &mg_dof_handler,
+              OutVector                                 &dst,
+              const MGLevelObject<BlockVector<number> > &src) const
 {
 
   const FiniteElement<dim>& fe = mg_dof_handler.get_fe();
@@ -616,8 +633,8 @@ MGTransferBlock<number>::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<dim, dim>& global_cell = *level_cell;
@@ -638,15 +655,16 @@ MGTransferBlock<number>::copy_from_mg(
     }
 }
 
+
+
 template <typename number>
 template <int dim, class OutVector>
 void
-MGTransferBlock<number>::copy_from_mg_add(
-  const MGDoFHandler<dim>& mg_dof_handler,
-  OutVector &dst,
-  const MGLevelObject<BlockVector<number> > &src) const
+MGTransferBlock<number>::
+copy_from_mg_add (const MGDoFHandler<dim>                   &mg_dof_handler,
+                  OutVector                                 &dst,
+                  const MGLevelObject<BlockVector<number> > &src) const
 {
-
   const FiniteElement<dim>& fe = mg_dof_handler.get_fe();
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
 
@@ -662,7 +680,8 @@ MGTransferBlock<number>::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<dim, dim>& global_cell = *level_cell;
index 00addb92007cbaca6a13c12503c7ea1fccb9170c..c4588bf89530b294d2235f9a0c0af19b31d80779 100644 (file)
@@ -110,9 +110,9 @@ class MGTransferPrebuilt : public MGTransferBase<Vector<number> >
                                      */
     template<int dim, class InVector>
     void
-    copy_to_mg (const MGDoFHandler<dim>mg_dof,
+    copy_to_mg (const MGDoFHandler<dim>        &mg_dof,
                MGLevelObject<Vector<number> > &dst,
-               const InVector &src) const;
+               const InVector                 &src) const;
 
                                     /**
                                      * Transfer from multi-level vector to
@@ -128,8 +128,8 @@ class MGTransferPrebuilt : public MGTransferBase<Vector<number> >
                                      */
     template<int dim, class OutVector>
     void
-    copy_from_mg (const MGDoFHandler<dim>mg_dof,
-                 OutVector &dst,
+    copy_from_mg (const MGDoFHandler<dim>              &mg_dof,
+                 OutVector                            &dst,
                  const MGLevelObject<Vector<number> > &src) const;
 
                                     /**
@@ -142,8 +142,8 @@ class MGTransferPrebuilt : public MGTransferBase<Vector<number> >
                                      */
     template<int dim, class OutVector>
     void
-    copy_from_mg_add (const MGDoFHandler<dim>mg_dof,
-                     OutVector &dst,
+    copy_from_mg_add (const MGDoFHandler<dim>              &mg_dof,
+                     OutVector                            &dst,
                      const MGLevelObject<Vector<number> > &src) const;
 
                                     /**
@@ -201,7 +201,8 @@ class MGTransferPrebuilt : public MGTransferBase<Vector<number> >
 
 
 /**
- * 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<BlockVector<number> >,
                                      */
     template<int dim, class InVector>
     void
-    copy_to_mg (const MGDoFHandler<dim>mg_dof,
-               MGLevelObject<BlockVector<number> >dst,
-               const InVectorsrc) const;
+    copy_to_mg (const MGDoFHandler<dim>             &mg_dof,
+               MGLevelObject<BlockVector<number> > &dst,
+               const InVector                      &src) const;
 
                                     /**
                                      * Transfer from multi-level vector to
@@ -393,9 +394,9 @@ class MGTransferBlock : public MGTransferBase<BlockVector<number> >,
                                      */
     template<int dim, class OutVector>
     void
-    copy_from_mg (const MGDoFHandler<dim>mg_dof,
-                 OutVectordst,
-                 const MGLevelObject<BlockVector<number> >src) const;
+    copy_from_mg (const MGDoFHandler<dim>                   &mg_dof,
+                 OutVector                                 &dst,
+                 const MGLevelObject<BlockVector<number> > &src) const;
 
                                     /**
                                      * Add a multi-level vector to a
@@ -407,9 +408,9 @@ class MGTransferBlock : public MGTransferBase<BlockVector<number> >,
                                      */
     template<int dim, class OutVector>
     void
-    copy_from_mg_add (const MGDoFHandler<dim>mg_dof,
-                     OutVectordst,
-                     const MGLevelObject<BlockVector<number> >src) const;
+    copy_from_mg_add (const MGDoFHandler<dim>                   &mg_dof,
+                     OutVector                                 &dst,
+                     const MGLevelObject<BlockVector<number> > &src) const;
 };
 
 
@@ -501,9 +502,9 @@ class MGTransferSelect : public MGTransferBase<Vector<number> >,
                                      */
     template<int dim, class InVector>
     void
-    copy_to_mg (const MGDoFHandler<dim>mg_dof,
+    copy_to_mg (const MGDoFHandler<dim>        &mg_dof,
                MGLevelObject<Vector<number> > &dst,
-               const InVector &src) const;
+               const InVector                 &src) const;
 
                                     /**
                                      * Transfer from multi-level vector to
@@ -519,8 +520,8 @@ class MGTransferSelect : public MGTransferBase<Vector<number> >,
                                      */
     template<int dim, class OutVector>
     void
-    copy_from_mg (const MGDoFHandler<dim>mg_dof,
-                 OutVector &dst,
+    copy_from_mg (const MGDoFHandler<dim>              &mg_dof,
+                 OutVector                            &dst,
                  const MGLevelObject<Vector<number> > &src) const;
 
                                     /**
@@ -533,16 +534,15 @@ class MGTransferSelect : public MGTransferBase<Vector<number> >,
                                      */
     template<int dim, class OutVector>
     void
-    copy_from_mg_add (const MGDoFHandler<dim>mg_dof,
-                     OutVector &dst,
+    copy_from_mg_add (const MGDoFHandler<dim>              &mg_dof,
+                     OutVector                            &dst,
                      const MGLevelObject<Vector<number> > &src) const;
 
   private:
-
-                                  /**
-                                   * Selected component.
-                                   */
-  unsigned int selected;
+                                     /**
+                                      * Selected component.
+                                      */
+    unsigned int selected;
 };
 
 
index 9a21298999aeae515603b98b4c0333bcc5f24cce..a227d12520e04417db46883ba8fc3ee0b55703ab 100644 (file)
@@ -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<const MGDoFHandler<deal_II_dimension> > mg_dof_handler;
 #endif
index e235a3a135f6a8e26ae8066a84c3f976418ab644..81a7de7290b595cbbf69feaa5d58a5b2047acfd5 100644 (file)
 #include <multigrid/multigrid.h>
 
 #ifdef MG_DEBUG
-#include <fe/fe.h>
-#include <dofs/dof_accessor.h>
-#include <numerics/data_out.h>
-#include <multigrid/mg_dof_accessor.h>
-#include <multigrid/mg_dof_handler.h>
-#include <fstream>
+#  include <fe/fe.h>
+#  include <dofs/dof_accessor.h>
+#  include <numerics/data_out.h>
+#  include <multigrid/mg_dof_accessor.h>
+#  include <multigrid/mg_dof_handler.h>
+
+#  include <fstream>
 #endif
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.