]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
MGTransferPrebuilt for BlockVector, MGTransferSelect works with target_components...
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 1 Apr 2004 11:15:47 +0000 (11:15 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 1 Apr 2004 11:15:47 +0000 (11:15 +0000)
git-svn-id: https://svn.dealii.org/trunk@8935 0785d39b-7218-0410-832d-ea1e28bc413d

12 files changed:
deal.II/common/scripts/status.pl
deal.II/contrib/dx/single/scalar.cfg
deal.II/contrib/dx/single/scalar.net
deal.II/deal.II/include/multigrid/mg_base.h
deal.II/deal.II/include/multigrid/mg_transfer.h
deal.II/deal.II/include/multigrid/mg_transfer.templates.h
deal.II/deal.II/include/multigrid/multigrid.h
deal.II/deal.II/source/multigrid/mg_transfer_block.cc
deal.II/deal.II/source/multigrid/mg_transfer_prebuilt.cc
deal.II/deal.II/source/multigrid/multigrid.all_dimensions.cc
tests/fe/transfer.cc
tests/multigrid/transfer.cc

index 991154c335230241bd9c839e7266dbba8174525d..9b43f4075aaacd7668f15faf9b477a936694cea0 100644 (file)
@@ -58,15 +58,16 @@ while(<CVS>)
        } else {
            $status = "$status $work $rep ";
        }
-
+       
+       $tag =~ s/ .*//;
        $tag = '' if ($tag eq '(none)');
        $date = '' if ($date eq '(none)');
        $opt = '' if ($opt eq '(none)');
-       $opt = '' if ($opt eq '-kk');
+#      $opt = '' if ($opt eq '-kk');
        my $stick = $tag . $date . $opt;
-       $stick = "Stick $stick" unless ($stick eq '');
+       $stick = "$stick" unless ($stick eq '');
        $status .= $stick;
-       printf "%-40s %-20s %s\n", $file, $status,
+       printf "%-40s %-30s %s\n", $file, $status,
        (($short) ? '' : $rep_file)
            unless ($compress && ($status eq 'OK '));
     }
index 80ac72710fcb836c88669b7d2023ac565c706717..e29a67d6607ba065ba529d97e2305d10330c165b 100644 (file)
@@ -1,40 +1,40 @@
 //
-// time: Mon Dec 10 11:19:00 2001
+// time: Sun Feb 22 22:08:26 2004
 //
-// version: 3.1.2 (format), 4.1.3 (DX)
+// version: 3.1.2 (format), 4.2.0 (DX)
 //
 // Message Window:
-// window: position = (0.5148,0.0039), size = 0.4781x0.2568
+// window: position = (0.5149,0.0038), size = 0.4780x0.2571
 //
-// panel[0]: position = (0.6203,0.5889), size = 0.3047x0.2666, startup = 1, devstyle = 1
+// panel[0]: position = (0.6202,0.5886), size = 0.3048x0.2667, startup = 1, devstyle = 1
 // title: value = Control Panel
 //
 // workspace: width = 196, height = 145
 // layout: snap = 1, width = 50, height = 50, align = NL
 //
-// interactor FileSelector[1]: num_components = 1, value = NULL
+// interactor FileSelector[1]: num_components = 1, value = "/home/kanschat/deal.II/gk/n/slug.04.dx"
 // instance: panel = 0, x = 0, y = 6, style = FileSelector, vertical = 1, size = 196x57
 // filter = *.dx
 //
-// interactor Integer[1]: num_components = 1, value = 11 
-// component[0]: minimum = 0, maximum = 14, global increment = 1, decimal = 0, global continuous = 0
+// interactor Integer[1]: num_components = 1, value = 2
+// component[0]: minimum = 0, maximum = 4, global increment = 1, decimal = 0, global continuous = 0
 // instance: panel = 0, x = 0, y = 89, style = Stepper, vertical = 1, size = 118x56
 // label: value = Component:
 // local continuous: value = 1, mode = local
 // local increment[0]: value = 1, mode = global
 //
 // node Image[1]:
-// depth: value = 8
-// window: position = (0.0000,0.1338), size = 0.5195x0.6553
+// depth: value = 24
+// window: position = (0.0000,0.1333), size = 0.5196x0.6552
 // input[1]: defaulting = 0, value = "Image_1"
 // input[4]: defaulting = 0, value = 1
-// input[5]: defaulting = 0, value = [0 0 0]
-// input[6]: defaulting = 0, value = [0 0 5.55279]
-// input[7]: defaulting = 0, value = 2.97574
-// input[8]: defaulting = 0, value = 651
-// input[9]: defaulting = 0, value = 0.963902
+// input[5]: defaulting = 0, value = [0.5 1 0]
+// input[6]: defaulting = 0, value = [0.5 1 7.10757]
+// input[7]: defaulting = 0, value = 3.80895
+// input[8]: defaulting = 0, value = 859
+// input[9]: defaulting = 0, value = 0.75
 // input[10]: defaulting = 0, value = [0 1 0]
-// input[11]: defaulting = 1, value = 30.0001
+// input[11]: defaulting = 0, value = 30.0001
 // input[12]: defaulting = 0, value = 0
 // input[14]: defaulting = 0, value = 1
 // input[15]: defaulting = 1, value = "none"
@@ -44,7 +44,7 @@
 // input[19]: defaulting = 0, value = 0
 // input[22]: defaulting = 0, value = "white"
 // input[26]: defaulting = 0, value = "eps color dpi=65 orient=landscape"
-// input[29]: defaulting = 0, value = 1
+// input[29]: defaulting = 0, value = 0
 // input[30]: defaulting = 0, value = {"x", "y", "z"}
 // input[33]: defaulting = 0, value = 0
 // input[36]: defaulting = 0, value = 0
index fea9b89b1409e06cfd51a2c5b90a9ae5b15087c0..b26967831ea3790a4a33e109587edafa90523aea 100644 (file)
@@ -1,14 +1,14 @@
 //
-// time: Mon Dec 10 11:19:00 2001
+// time: Sun Feb 22 22:08:26 2004
 //
-// version: 3.1.2 (format), 4.1.3 (DX)
+// version: 3.1.2 (format), 4.2.0 (DX)
 //
 //
 // MODULE main
-// page assignment: Color      order=2, windowed=0, showing=1
-// page assignment: Display    order=3, windowed=0, showing=0
-// page assignment: Input      order=1, windowed=0, showing=0
-// workspace: width = 500, height = 551
+// page assignment: Color      order=3, windowed=0, showing=1
+// page assignment: Display    order=4, windowed=0, showing=0
+// page assignment: Input      order=2, windowed=0, showing=0
+// workspace: width = 435, height = 551
 // layout: snap = 1, width = 50, height = 80, align = CC
 //
 macro main(
@@ -16,8 +16,8 @@ macro main(
 ) {
     // 
     // node FileSelector[1]: x = 331, y = 9, inputs = 0, label = FileSelector
-    // output[1]: visible = 1, type = 32, value = NULL
-    // output[2]: visible = 1, type = 32, value = NULL
+    // output[1]: visible = 1, type = 32, value = "/home/kanschat/deal.II/gk/n/slug.04.dx"
+    // output[2]: visible = 1, type = 32, value = "slug.04.dx"
     // page group: Input
     //
     // 
@@ -57,15 +57,15 @@ main_Inquire_1_out_1 =
     // 
     // node Integer[1]: x = 141, y = 329, inputs = 11, label = Integer
     // input[1]: defaulting = 0, visible = 0, type = 32, value = "Integer_1"
-    // input[3]: defaulting = 0, visible = 0, type = 1, value = 11 
+    // input[3]: defaulting = 0, visible = 0, type = 1, value = 2
     // input[4]: visible = 1
     // input[5]: defaulting = 0, visible = 1, type = 1, value = 0
-    // input[6]: defaulting = 1, visible = 1, type = 1, value = 14
+    // input[6]: defaulting = 1, visible = 1, type = 1, value = 4
     // input[7]: defaulting = 1, visible = 1, type = 5, value = 1.0
     // input[8]: visible = 1
     // input[9]: defaulting = 1, visible = 0, type = 1, value = 0
     // input[11]: defaulting = 1, visible = 1, type = 32, value = "Component select"
-    // output[1]: visible = 1, type = 1, value = 11 
+    // output[1]: visible = 1, type = 1, value = 2
     // page group: Input
     //
 main_Integer_1_out_1[cache: 2] = 
@@ -289,23 +289,23 @@ main_Collect_2_out_1 =
     // node Image[1]: x = 239, y = 329, inputs = 49, label = Image
     // input[1]: defaulting = 0, visible = 0, type = 67108863, value = "Image_1"
     // input[4]: defaulting = 0, visible = 0, type = 1, value = 1
-    // input[5]: defaulting = 0, visible = 0, type = 8, value = [0 0 0]
-    // input[6]: defaulting = 0, visible = 0, type = 8, value = [0 0 5.55279]
-    // input[7]: defaulting = 0, visible = 0, type = 5, value = 2.97574
-    // input[8]: defaulting = 0, visible = 0, type = 1, value = 651
-    // input[9]: defaulting = 0, visible = 0, type = 5, value = 0.963902
+    // input[5]: defaulting = 0, visible = 0, type = 8, value = [0.5 1 0]
+    // input[6]: defaulting = 0, visible = 0, type = 8, value = [0.5 1 7.10757]
+    // input[7]: defaulting = 0, visible = 0, type = 5, value = 3.80895
+    // input[8]: defaulting = 0, visible = 0, type = 1, value = 859
+    // input[9]: defaulting = 0, visible = 0, type = 5, value = 0.75
     // input[10]: defaulting = 0, visible = 0, type = 8, value = [0 1 0]
-    // input[11]: defaulting = 1, visible = 0, type = 5, value = 30.0001
+    // input[11]: defaulting = 0, visible = 0, type = 5, value = 30.0001
     // input[12]: defaulting = 0, visible = 0, type = 1, value = 0
     // input[14]: defaulting = 0, visible = 0, type = 1, value = 1
     // input[15]: defaulting = 1, visible = 0, type = 32, value = "none"
     // input[16]: defaulting = 1, visible = 0, type = 32, value = "none"
     // input[17]: defaulting = 1, visible = 0, type = 1, value = 1
     // input[18]: defaulting = 1, visible = 0, type = 1, value = 1
-    // input[19]: defaulting = 0, visible = 0, type = 3, value = 0
+    // input[19]: defaulting = 0, visible = 0, type = 1, value = 0
     // input[22]: defaulting = 0, visible = 0, type = 32, value = "white"
     // input[26]: defaulting = 0, visible = 0, type = 32, value = "eps color dpi=65 orient=landscape"
-    // input[29]: defaulting = 0, visible = 0, type = 3, value = 1
+    // input[29]: defaulting = 0, visible = 0, type = 3, value = 0
     // input[30]: defaulting = 0, visible = 0, type = 16777248, value = {"x", "y", "z"}
     // input[33]: defaulting = 0, visible = 0, type = 3, value = 0
     // input[36]: defaulting = 0, visible = 0, type = 3, value = 0
@@ -314,8 +314,8 @@ main_Collect_2_out_1 =
     // input[39]: defaulting = 0, visible = 0, type = 5, value = 0.5
     // input[41]: defaulting = 0, visible = 0, type = 32, value = "none"
     // page group: Display
-    // depth: value = 8
-    // window: position = (0.0000,0.1338), size = 0.5195x0.6553
+    // depth: value = 24
+    // window: position = (0.0000,0.1333), size = 0.5196x0.6552
     // internal caching: 1
     //
 main_Image_1_out_1[cache: 0],
@@ -375,8 +375,8 @@ main_Image_1_out_3[cache: 0] =
 // network: end of macro body
 CacheScene(main_Image_1_in_1, main_Image_1_out_1, main_Image_1_out_2);
 }
-main_FileSelector_1_out_1 = NULL;
-main_FileSelector_1_out_2 = NULL;
+main_FileSelector_1_out_1 = "/home/kanschat/deal.II/gk/n/slug.04.dx";
+main_FileSelector_1_out_2 = "slug.04.dx";
 main_Import_1_in_2 = NULL;
 main_Import_1_in_3 = NULL;
 main_Import_1_in_4 = NULL;
@@ -390,7 +390,7 @@ main_Inquire_1_in_3 = NULL;
 main_Inquire_1_out_1 = NULL;
 main_Integer_1_in_1 = "Integer_1";
 main_Integer_1_in_2 = NULL;
-main_Integer_1_in_3 = 11 ;
+main_Integer_1_in_3 = 2;
 main_Integer_1_in_4 = NULL;
 main_Integer_1_in_5 = 0;
 main_Integer_1_in_7 = NULL;
@@ -398,7 +398,7 @@ main_Integer_1_in_8 = NULL;
 main_Integer_1_in_9 = NULL;
 main_Integer_1_in_10 = NULL;
 main_Integer_1_in_11 = NULL;
-main_Integer_1_out_1 = 11 ;
+main_Integer_1_out_1 = 2;
 main_Compute_1_in_1 = "select($0,$1)";
 main_Compute_1_out_1 = NULL;
 main_Transmitter_1_out_1 = NULL;
@@ -777,15 +777,15 @@ macro Image(
         RECformat) [instance: 2, cache: 1];
 }
 main_Image_1_in_1 = "Image_1";
-main_Image_1_in_3 = "X8,,";
+main_Image_1_in_3 = "X24,,";
 main_Image_1_in_4 = 1;
-main_Image_1_in_5 = [0 0 0];
-main_Image_1_in_6 = [0 0 5.55279];
-main_Image_1_in_7 = 2.97574;
-main_Image_1_in_8 = 651;
-main_Image_1_in_9 = 0.963902;
+main_Image_1_in_5 = [0.5 1 0];
+main_Image_1_in_6 = [0.5 1 7.10757];
+main_Image_1_in_7 = 3.80895;
+main_Image_1_in_8 = 859;
+main_Image_1_in_9 = 0.75;
 main_Image_1_in_10 = [0 1 0];
-main_Image_1_in_11 = NULL;
+main_Image_1_in_11 = 30.0001;
 main_Image_1_in_12 = 0;
 main_Image_1_in_13 = NULL;
 main_Image_1_in_14 = 1;
@@ -802,7 +802,7 @@ main_Image_1_in_25 = NULL;
 main_Image_1_in_26 = "eps color dpi=65 orient=landscape";
 main_Image_1_in_27 = NULL;
 main_Image_1_in_28 = NULL;
-main_Image_1_in_29 = 1;
+main_Image_1_in_29 = 0;
 main_Image_1_in_30 = {"x", "y", "z"};
 main_Image_1_in_31 = NULL;
 main_Image_1_in_32 = NULL;
@@ -823,6 +823,6 @@ main_Image_1_in_46 = NULL;
 main_Image_1_in_47 = NULL;
 main_Image_1_in_48 = NULL;
 main_Image_1_in_49 = NULL;
-Executive("product version 4 1 3");
+Executive("product version 4 2 0");
 $sync
 main();
index bc0859e92fbac33b2012b03998388ac2223380a5..80bcedc2bd740359a323d8e0dee2850dc5fdf8a9 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal.II authors
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -32,8 +32,8 @@
  * multilevel algorithms. It has no relation to the actual matrix type
  * and takes the vector class as only template argument.
  *
- * Usually, the derived class @ref{MGMatrix}, operating on an
- * @ref{MGLevelObject} of matrices will be sufficient for applications.
+ * Usually, the derived class MGMatrix, operating on an
+ * MGLevelObject of matrices will be sufficient for applications.
  *
  * @author Guido Kanschat, 2002
  */
@@ -107,25 +107,26 @@ class MGCoarseGridBase : public Subscriptor
 /**
  * Base class used to declare the operations needed by a concrete class
  * implementing prolongation and restriction of vectors in the multigrid
- * context. This class is an abstract one and has no implementations of
- * possible algorithms for these operations.
+ * context. This class is abstract and has no implementation of
+ * these operations.
  *
  * There are several derived classes, reflecting the fact that vector
  * types and numbering of the fine-grid discretization and of the
  * multi-level implementation are independent.
  *
  * If you use multigrid for your complete system of equations, you
- * will use @ref{MGTransferPrebuilt} together with Multigrid for
- * Vector objects. The fine-grid vectors may still be of type
- * BlockVector.
+ * will use MGTransferPrebuilt together with Multigrid. The vector
+ * types used on the fine grid as well as for the multilevel
+ * operations may be Vector or BlockVector. In both cases,
+ * MGTransferPrebuilt will operate on all components of the solution.
  *
  * For mixed systems, it may be required to do multigrid only for a
  * single component or for some components. The classes
- * @ref{MGTransferSelect} and @ref{MGTransferBlock} handle these cases.
+ * MGTransferSelect and MGTransferBlock handle these cases.
  *
- * MGTransferSelect is used if you use mutligrid (on Vector oblects)
+ * MGTransferSelect is used if you use mutligrid (on Vector objects)
  * for a single component, possibly grouped using
- * @p{mg_target_component}.
+ * <tt>mg_target_component</tt>.
  *
  * The class MGTransferBlock handles the case where your multigrid
  * method operates on BlockVector objects. These can contain all or a
@@ -148,18 +149,19 @@ class MGCoarseGridBase : public Subscriptor
 
                                     /**
                                      * Prolongate a vector from level
-                                     * @p{to_level-1} to level
-                                     * @p{to_level}. The previous
-                                     * content of @p{dst} is
+                                     * <tt>to_level-1</tt> to level
+                                     * <tt>to_level</tt>. The previous
+                                     * content of <tt>dst</tt> is
                                      * overwritten.
                                      *
-                                     * @p{src} is assumed to be a vector with
-                                     * as many elements as there are degrees
-                                     * of freedom on the coarser level of
-                                     * the two involved levels, while @p{src}
-                                     * shall have as many elements as there
-                                     * are degrees of freedom on the finer
-                                     * level.
+                                     * @arg src is a vector with as
+                                     * many elements as there are
+                                     * degrees of freedom on the
+                                     * coarser level involved.
+                                     *
+                                     * @arg dst has as many elements
+                                     * as there are degrees of
+                                     * freedom on the finer level.
                                      */
      virtual void prolongate (const unsigned int to_level,
                             VECTOR&            dst,
@@ -167,26 +169,30 @@ class MGCoarseGridBase : public Subscriptor
 
                                     /**
                                      * Restrict a vector from level
-                                     * @p{from_level} to level
-                                     * @p{from_level-1} and add this
-                                     * restriction to
-                                     * @p{dst}. Obviously, if the
-                                     * refined region on level
-                                     * @p{from_level} is smaller than
-                                     * that on level @p{from_level-1},
-                                     * some degrees of freedom in
-                                     * @p{dst} are not covered and will
-                                     * not be altered. For the other
-                                     * degress of freedom, the result
-                                     * of the restriction is added.
+                                     * <tt>from_level</tt> to level
+                                     * <tt>from_level-1</tt> and add
+                                     * this restriction to
+                                     * <tt>dst</tt>. If the region
+                                     * covered by cells on level
+                                     * <tt>from_level</tt> is smaller
+                                     * than that of level
+                                     * <tt>from_level-1</tt> (local
+                                     * refinement), then some degrees
+                                     * of freedom in <tt>dst</tt> are
+                                     * active and will not be
+                                     * altered. For the other degress
+                                     * of freedom, the result of the
+                                     * restriction is added.
                                      *
-                                     * @p{src} is assumed to be a vector with
-                                     * as many elements as there are degrees
-                                     * of freedom on the finer level of
-                                     * the two involved levels, while @p{src}
-                                     * shall have as many elements as there
+                                     * @arg src is a vector with as
+                                     * many elements as there are
+                                     * degrees of freedom on the
+                                     * finer level
+                                     *
+                                     * @arg dst has as many elements as there
                                      * are degrees of freedom on the coarser
                                      * level.
+                                     *
                                      */
      virtual void restrict_and_add (const unsigned int from_level,
                                   VECTOR&            dst,
index 8c0200dc1866db82ea5b3180d5a58e2d49692adc..1f2f62ff532f1668626f0961e2539bf3d5cf7016 100644 (file)
@@ -13,6 +13,7 @@
 #ifndef __deal2__mg_transfer_h
 #define __deal2__mg_transfer_h
 
+#include <base/config.h>
 
 #include <lac/block_vector.h>
 #ifdef DEAL_PREFER_MATRIX_EZ
@@ -35,19 +36,19 @@ template <int dim> class MGDoFHandler;
  */
 
 /**
- * Implementation of the @p{MGTransferBase} interface for which the transfer
+ * Implementation of the MGTransferBase interface for which the transfer
  * operations are prebuilt upon construction of the object of this class as
  * matrices. This is the fast way, since it only needs to build the operation
  * once by looping over all cells and storing the result in a matrix for
  * each level, but requires additional memory.
  *
- * See @ref{MGTransferBase} to find out which of the transfer classes
+ * See MGTransferBase to find out which of the transfer classes
  * is best for your needs.
  *
- * @author Wolfgang Bangerth, Guido Kanschat, 1999-2003
+ * @author Wolfgang Bangerth, Guido Kanschat, 1999-2004
  */
-template <typename number>
-class MGTransferPrebuilt : public MGTransferBase<Vector<number> 
+template <class VECTOR>
+class MGTransferPrebuilt : public MGTransferBase<VECTOR
 {
   public:
                                     /**
@@ -62,51 +63,13 @@ class MGTransferPrebuilt : public MGTransferBase<Vector<number> >
     template <int dim>
     void build_matrices (const MGDoFHandler<dim> &mg_dof);
 
-                                    /**
-                                     * Prolongate a vector from level
-                                     * @p{to_level-1} to level
-                                     * @p{to_level}. The previous
-                                     * content of @p{dst} is
-                                     * overwritten.
-                                     *
-                                     * @p{src} is assumed to be a vector with
-                                     * as many elements as there are degrees
-                                     * of freedom on the coarser level of
-                                     * the two involved levels, while @p{src}
-                                     * shall have as many elements as there
-                                     * are degrees of freedom on the finer
-                                     * level.
-                                     */
     virtual void prolongate (const unsigned int    to_level,
-                            Vector<number>       &dst,
-                            const Vector<number> &src) const;
+                            VECTOR       &dst,
+                            const VECTOR &src) const;
 
-                                    /**
-                                     * Restrict a vector from level
-                                     * @p{from_level} to level
-                                     * @p{from_level-1} and add this
-                                     * restriction to
-                                     * @p{dst}. Obviously, if the
-                                     * refined region on level
-                                     * @p{from_level} is smaller than
-                                     * that on level @p{from_level-1},
-                                     * some degrees of freedom in
-                                     * @p{dst} are not covered and will
-                                     * not be altered. For the other
-                                     * degress of freedom, the result
-                                     * of the restriction is added.
-                                     *
-                                     * @p{src} is assumed to be a vector with
-                                     * as many elements as there are degrees
-                                     * of freedom on the finer level of
-                                     * the two involved levels, while @p{src}
-                                     * shall have as many elements as there
-                                     * are degrees of freedom on the coarser
-                                     * level.
-                                     */
     virtual void restrict_and_add (const unsigned int    from_level,
-                                  Vector<number>       &dst,
-                                  const Vector<number> &src) const;
+                                  VECTOR       &dst,
+                                  const VECTOR &src) const;
 
                                     /**
                                      * Transfer from a vector on the
@@ -116,9 +79,9 @@ class MGTransferPrebuilt : public MGTransferBase<Vector<number> >
                                      */
     template <int dim, class InVector>
     void
-    copy_to_mg (const MGDoFHandler<dim>        &mg_dof,
-               MGLevelObject<Vector<number> > &dst,
-               const InVector                 &src) const;
+    copy_to_mg (const MGDoFHandler<dim>mg_dof,
+               MGLevelObject<VECTOR>& dst,
+               const InVector&          src) const;
 
                                     /**
                                      * Transfer from multi-level vector to
@@ -136,7 +99,7 @@ class MGTransferPrebuilt : public MGTransferBase<Vector<number> >
     void
     copy_from_mg (const MGDoFHandler<dim>              &mg_dof,
                  OutVector                            &dst,
-                 const MGLevelObject<Vector<number> > &src) const;
+                 const MGLevelObject<VECTOR> &src) const;
 
                                     /**
                                      * Add a multi-level vector to a
@@ -150,7 +113,7 @@ class MGTransferPrebuilt : public MGTransferBase<Vector<number> >
     void
     copy_from_mg_add (const MGDoFHandler<dim>              &mg_dof,
                      OutVector                            &dst,
-                     const MGLevelObject<Vector<number> > &src) const;
+                     const MGLevelObject<VECTOR> &src) const;
 
                                     /**
                                      * Finite element does not
@@ -220,7 +183,7 @@ class MGTransferPrebuilt : public MGTransferBase<Vector<number> >
     
                                     /**
                                      * Implementation of the
-                                     * @p{copy_to_mg} function for
+                                     * copy_to_mg() function for
                                      * 1d. We have to resort to some
                                      * template trickery because we
                                      * can't specialize template
@@ -238,7 +201,7 @@ class MGTransferPrebuilt : public MGTransferBase<Vector<number> >
     template <int dim, class InVector>
     void
     copy_to_mg (const MGDoFHandler<dim>        &mg_dof,
-               MGLevelObject<Vector<number> > &dst,
+               MGLevelObject<VECTOR> &dst,
                const InVector                 &src,
                const is_1d<true>              &) const;
 
@@ -249,15 +212,15 @@ class MGTransferPrebuilt : public MGTransferBase<Vector<number> >
     template <int dim, class InVector>
     void
     copy_to_mg (const MGDoFHandler<dim>        &mg_dof,
-               MGLevelObject<Vector<number> > &dst,
+               MGLevelObject<VECTOR> &dst,
                const InVector                 &src,
                const is_1d<false>             &) const;
 };
 
 
 /**
- * Implementation of matrix generation for @ref{MGTransferBlock} and
- * @p{MGTransferSelect}.
+ * Implementation of matrix generation for MGTransferBlock and
+ * MGTransferSelect.
  *
  * @author Guido Kanschat, 2001-2003
  */
@@ -283,8 +246,9 @@ class MGTransferBlockBase
                                      *
                                      * This function is only called
                                      * by derived classes. These can
-                                     * also set the member variable
-                                     * @p{target_component} for
+                                     * also set the member variables
+                                     * #target_component and
+                                     * #mg_target_component for
                                      * re-ordering and grouping of
                                      * components.
                                      */
@@ -294,11 +258,34 @@ class MGTransferBlockBase
 
                                   /**
                                    * Flag of selected components.
+                                   *
+                                   * The transfer operators only act
+                                   * on the components having a
+                                   * <tt>true</tt> entry here. If
+                                   * renumbering by
+                                   * #target_component is used,
+                                   * this refers to the
+                                   * <b>renumbered</b> components.
                                    */
     std::vector<bool> selected;
 
+                                  /**
+                                   * Flag of selected components.
+                                   *
+                                   * The transfer operators only act
+                                   * on the components having a
+                                   * <tt>true</tt> entry here. If
+                                   * renumbering by
+                                   * #mg_target_component is used,
+                                   * this refers to the
+                                   * <b>renumbered</b> components.
+                                   */
+    std::vector<bool> mg_selected;
+
                                     /**
-                                     * Target component if renumbering is required.
+                                     * Target component of the
+                                     * fine-level vector if
+                                     * renumbering is required.
                                      */
     std::vector<unsigned int> target_component;
     
@@ -326,7 +313,7 @@ class MGTransferBlockBase
     std::vector<std::vector<unsigned int> > mg_component_start;
 
                                     /**
-                                     * Call @p{build_matrices}
+                                     * Call build_matrices()
                                      * function first.
                                      */
     DeclException0(ExcMatricesNotBuilt);
@@ -364,7 +351,7 @@ class MGTransferBlockBase
 //TODO:[GK] Update this class
 
 /**
- * Implementation of the @p{MGTransferBase} interface for block
+ * Implementation of the MGTransferBase interface for block
  * matrices and block vectors.
  *
  * Warning! Due to additional requirements on MGTransferSelect, the
@@ -398,22 +385,34 @@ class MGTransferBlock : public MGTransferBase<BlockVector<number> >,
                                     /**
                                      * Build the prolongation
                                      * matrices for each level.
-                                     *
-                                     * If a field selected is given,
-                                     * only matrices for these
-                                     * components are to be built. By
-                                     * default, all matrices are
-                                     * built.
-                                     *
-                                     * The last argument
-                                     * @p{target_component} allows
-                                     * grouping of components the
-                                     * same way as in
-                                     * @p{DoFRenumbering::component_wise}.
                                      * 
                                      * This function is a front-end
                                      * for the same function in
-                                     * @ref{MGTransferBlockBase}.
+                                     * MGTransferBlockBase.
+                                     *
+                                     * @arg selected: Opional
+                                     * argument indicating that only
+                                     * matrices for these components
+                                     * are to be built. By default,
+                                     * all matrices are built.
+                                     *
+                                     * If <tt>mg_target_component</tt> is
+                                     * present, this refers to the
+                                     * renumbered components.
+                                     *
+                                     * @arg target_component: this
+                                     * argument allows grouping and
+                                     * renumbering of components in
+                                     * the fine-level vector (see
+                                     * DoFRenumbering::component_wise).
+                                     * 
+                                     * @arg mg_target_component: this
+                                     * argument allows grouping and
+                                     * renumbering of components in
+                                     * the level vectors (see
+                                     * DoFRenumbering::component_wise). It
+                                     * also affects the behavior of
+                                     * the <tt>selected</tt> argument
                                      */
     template <int dim>
     void build_matrices (const MGDoFHandler<dim> &mg_dof,
@@ -423,57 +422,35 @@ class MGTransferBlock : public MGTransferBase<BlockVector<number> >,
                         const std::vector<unsigned int>& mg_target_component
                         =std::vector<unsigned int>());
 
-                                    /**
-                                     * Prolongate a vector from level
-                                     * @p{to_level-1} to level
-                                     * @p{to_level}. The previous
-                                     * content of @p{dst} is
-                                     * overwritten.
-                                     *
-                                     * @p{src} is assumed to be a vector with
-                                     * as many elements as there are degrees
-                                     * of freedom on the coarser level of
-                                     * the two involved levels, while @p{src}
-                                     * shall have as many elements as there
-                                     * are degrees of freedom on the finer
-                                     * level.
-                                     */
     virtual void prolongate (const unsigned int    to_level,
                             BlockVector<number>       &dst,
                             const BlockVector<number> &src) const;
 
-                                    /**
-                                     * Restrict a vector from level
-                                     * @p{from_level} to level
-                                     * @p{from_level-1} and add this
-                                     * restriction to
-                                     * @p{dst}. Obviously, if the
-                                     * refined region on level
-                                     * @p{from_level} is smaller than
-                                     * that on level @p{from_level-1},
-                                     * some degrees of freedom in
-                                     * @p{dst} are not covered and will
-                                     * not be altered. For the other
-                                     * degress of freedom, the result
-                                     * of the restriction is added.
-                                     *
-                                     * @p{src} is assumed to be a vector with
-                                     * as many elements as there are degrees
-                                     * of freedom on the finer level of
-                                     * the two involved levels, while @p{src}
-                                     * shall have as many elements as there
-                                     * are degrees of freedom on the coarser
-                                     * level.
-                                     */
     virtual void restrict_and_add (const unsigned int    from_level,
                                   BlockVector<number>       &dst,
                                   const BlockVector<number> &src) const;
 
                                     /**
                                      * Transfer from a vector on the
-                                     * global grid to vectors defined
-                                     * on each of the levels
-                                     * separately, i.a. an @p{MGVector}.
+                                     * global grid to a multilevel
+                                     * vector.
+                                     *
+                                     * The action for discontinuous
+                                     * elements is as follows: on an
+                                     * active mesh cell, the global
+                                     * vector entries are simply
+                                     * copied to the corresponding
+                                     * entries of the level
+                                     * vector. Then, these values are
+                                     * restricted down to the
+                                     * coarsest level.
+                                     *
+                                     * If the arguments
+                                     * <tt>target_component</tt> and
+                                     * <tt>mg_target_component</tt>
+                                     * was used in build_matrices(),
+                                     * then the blocks are shuffled
+                                     * around accordingly.
                                      */
     template <int dim, class InVector>
     void
@@ -486,12 +463,16 @@ class MGTransferBlock : public MGTransferBase<BlockVector<number> >,
                                      * normal vector.
                                      *
                                      * Copies data from active
-                                     * portions of an MGVector into
-                                     * the respective positions of a
-                                     * @p{Vector<number>}. In order to
-                                     * keep the result consistent,
-                                     * constrained degrees of freedom
-                                     * are set to zero.
+                                     * portions of a multilevel
+                                     * vector into the respective
+                                     * positions of a global vector.
+                                     *
+                                     * If the arguments
+                                     * <tt>target_component</tt> and
+                                     * <tt>mg_target_component</tt>
+                                     * was used in build_matrices(),
+                                     * then the blocks are shuffled
+                                     * around accordingly.
                                      */
     template <int dim, class OutVector>
     void
@@ -569,13 +550,13 @@ class MGTransferBlock : public MGTransferBase<BlockVector<number> >,
 //TODO:[GK] Update documentation for copy_* functions
 
 /**
- * Implementation of the @p{MGTransferBase} interface for block
- * matrices and simple vectors. This class uses @ref{MGTransferBlockBase}
+ * Implementation of the MGTransferBase interface for block
+ * matrices and simple vectors. This class uses MGTransferBlockBase
  * selecting a single component or grouping several components into a
  * single block. The transfer operators themselves are implemented for
  * Vector and BlockVector objects.
  *
- * See @ref{MGTransferBase} to find out which of the transfer classes
+ * See MGTransferBase to find out which of the transfer classes
  * is best for your needs.
  *
  * @author Guido Kanschat, 2001, 2002, 2003
@@ -594,29 +575,39 @@ class MGTransferSelect : public MGTransferBase<Vector<number> >,
                                      * Actually build the prolongation
                                      * matrices for grouped components.
                                      *
-                                     * @p{selected} tells the copy
-                                     * functions operating on single
-                                     * vectors, which component this
-                                     * vector belongs to.
+                                     * This function is a front-end
+                                     * for the same function in
+                                     * MGTransferBlockBase.
+                                     *
+                                     * @arg selected: Number of the
+                                     * component of the global vector
+                                     * to be copied from and to the
+                                     * multilevel vector. This number
+                                     * refers to the renumbering by
+                                     * <tt>target_component</tt>.
                                      *
-                                     * @p{mg_selected} is the number
+                                     * @arg mg_selected: Number
                                      * of the component for which the
                                      * transfer matrices should be
                                      * built.
                                      *
-                                     * The argument
-                                     * @p{target_component}
-                                     * corresponds to the grouping
-                                     * mechanism of
-                                     * @p{DoFRenumbering::component_wise(...)},
-                                     * which should be used to create
-                                     * the corresponding block
-                                     * structure in matrices and
-                                     * vectors.
+                                     * If <tt>mg_target_component</tt> is
+                                     * present, this refers to the
+                                     * renumbered components.
                                      *
-                                     * This function is a front-end
-                                     * for the same function in
-                                     * @ref{MGTransferBlockBase}.
+                                     * @arg target_component: this
+                                     * argument allows grouping and
+                                     * renumbering of components in
+                                     * the fine-level vector (see
+                                     * DoFRenumbering::component_wise).
+                                     * 
+                                     * @arg mg_target_component: this
+                                     * argument allows grouping and
+                                     * renumbering of components in
+                                     * the level vectors (see
+                                     * DoFRenumbering::component_wise). It
+                                     * also affects the behavior of
+                                     * the <tt>selected</tt> argument
                                      */
     template <int dim>
     void build_matrices (const MGDoFHandler<dim> &mg_dof,
@@ -631,50 +622,13 @@ class MGTransferSelect : public MGTransferBase<Vector<number> >,
                                      * Change selected
                                      * component. Handle with care!
                                      */
-    void select (const unsigned int component);
+    void select (const unsigned int component,
+                const unsigned int mg_component = deal_II_numbers::invalid_unsigned_int);
     
-                                    /**
-                                     * Prolongate a vector from level
-                                     * @p{to_level-1} to level
-                                     * @p{to_level}. The previous
-                                     * content of @p{dst} is
-                                     * overwritten.
-                                     *
-                                     * @p{src} is assumed to be a vector with
-                                     * as many elements as there are degrees
-                                     * of freedom on the coarser level of
-                                     * the two involved levels, while @p{src}
-                                     * shall have as many elements as there
-                                     * are degrees of freedom on the finer
-                                     * level.
-                                     */
     virtual void prolongate (const unsigned int    to_level,
                             Vector<number>       &dst,
                             const Vector<number> &src) const;
 
-                                    /**
-                                     * Restrict a vector from level
-                                     * @p{from_level} to level
-                                     * @p{from_level-1} and add this
-                                     * restriction to
-                                     * @p{dst}. Obviously, if the
-                                     * refined region on level
-                                     * @p{from_level} is smaller than
-                                     * that on level @p{from_level-1},
-                                     * some degrees of freedom in
-                                     * @p{dst} are not covered and will
-                                     * not be altered. For the other
-                                     * degress of freedom, the result
-                                     * of the restriction is added.
-                                     *
-                                     * @p{src} is assumed to be a vector with
-                                     * as many elements as there are degrees
-                                     * of freedom on the finer level of
-                                     * the two involved levels, while @p{src}
-                                     * shall have as many elements as there
-                                     * are degrees of freedom on the coarser
-                                     * level.
-                                     */
     virtual void restrict_and_add (const unsigned int    from_level,
                                   Vector<number>       &dst,
                                   const Vector<number> &src) const;
@@ -682,21 +636,19 @@ class MGTransferSelect : public MGTransferBase<Vector<number> >,
                                     /**
                                      * Structure that is used to
                                      * disambiguate calls to
-                                     * @p{copy_to_mg} for 1d and
+                                     * copy_to_mg() for 1d and
                                      * non-1d. We provide two
-                                     * functions of @p{copy_to_mg},
+                                     * functions of copy_to_mg(),
                                      * where the 1d function takes an
                                      * argument of type
-                                     * @p{is_1d<true>} and the other
-                                     * one of type @p{is_1d<false>}.
+                                     * <tt>is_1d<true></tt> and the other
+                                     * one of type <tt>is_1d<false></tt>}.
                                      */
     template <bool> struct is_1d {};
     
                                     /**
                                      * Transfer from a vector on the
-                                     * global grid to vectors defined
-                                     * on each of the levels
-                                     * separately, i.a. an @p{MGVector}.
+                                     * global grid to a multilevel vector.
                                      */
     template <int dim, typename number2>
     void
@@ -705,16 +657,13 @@ class MGTransferSelect : public MGTransferBase<Vector<number> >,
                const Vector<number2>          &src) const;
 
                                     /**
-                                     * Transfer from multi-level vector to
+                                     * Transfer from multilevel vector to
                                      * normal vector.
                                      *
                                      * Copies data from active
-                                     * portions of an MGVector into
-                                     * the respective positions of a
-                                     * @p{Vector<number>}. In order to
-                                     * keep the result consistent,
-                                     * constrained degrees of freedom
-                                     * are set to zero.
+                                     * portions of an multilevel
+                                     * vector into the respective
+                                     * positions of a Vector.
                                      */
     template <int dim, typename number2>
     void
@@ -738,9 +687,7 @@ class MGTransferSelect : public MGTransferBase<Vector<number> >,
 
                                     /**
                                      * Transfer from a vector on the
-                                     * global grid to vectors defined
-                                     * on each of the levels
-                                     * separately, i.a. an @p{MGVector}.
+                                     * global grid to multilevel vectors.
                                      */
     template <int dim, typename number2>
     void
@@ -749,16 +696,14 @@ class MGTransferSelect : public MGTransferBase<Vector<number> >,
                const BlockVector<number2>     &src) const;
 
                                     /**
-                                     * Transfer from multi-level vector to
+                                     * Transfer from multilevel vector to
                                      * normal vector.
                                      *
                                      * Copies data from active
-                                     * portions of an MGVector into
-                                     * the respective positions of a
-                                     * @p{Vector<number>}. In order to
-                                     * keep the result consistent,
-                                     * constrained degrees of freedom
-                                     * are set to zero.
+                                     * portions of a multilevel
+                                     * vector into the respective
+                                     * positions of a global
+                                     * BlockVector.
                                      */
     template <int dim, typename number2>
     void
@@ -787,16 +732,8 @@ class MGTransferSelect : public MGTransferBase<Vector<number> >,
     
   private:
                                     /**
-                                     * Transfer from multi-level vector to
-                                     * normal vector.
-                                     *
-                                     * Copies data from active
-                                     * portions of an MGVector into
-                                     * the respective positions of a
-                                     * @p{Vector<number>}. In order to
-                                     * keep the result consistent,
-                                     * constrained degrees of freedom
-                                     * are set to zero.
+                                     * Implementation of the public
+                                     * function.
                                      */
     template <int dim, class OutVector>
     void
@@ -806,12 +743,8 @@ class MGTransferSelect : public MGTransferBase<Vector<number> >,
                     const unsigned int offset) const;
 
                                     /**
-                                     * Add a multi-level vector to a
-                                     * normal vector.
-                                     *
-                                     * Works as the previous
-                                     * function, but probably not for
-                                     * continuous elements.
+                                     * Implementation of the public
+                                     * function.
                                      */
     template <int dim, class OutVector>
     void
@@ -822,7 +755,7 @@ class MGTransferSelect : public MGTransferBase<Vector<number> >,
 
                                     /**
                                      * Implementation of the
-                                     * @p{copy_to_mg} function for
+                                     * copy_to_mg() function for
                                      * 1d. We have to resort to some
                                      * template trickery because we
                                      * can't specialize template
@@ -846,8 +779,9 @@ class MGTransferSelect : public MGTransferBase<Vector<number> >,
                   const is_1d<true>              &) const;
 
                                     /**
-                                     * Same for all other space
-                                     * dimensions.
+                                     * Implementation of the
+                                     * copy_to_mg() function for
+                                     * higher dimensions.
                                      */
     template <int dim, class InVector>
     void
@@ -858,17 +792,25 @@ class MGTransferSelect : public MGTransferBase<Vector<number> >,
                   const is_1d<false>             &) const;
 
                                      /**
-                                      * Selected component.
+                                      * Selected component of global vector.
                                       */
     unsigned int selected_component;
+                                     /**
+                                      * Selected component inside multigrid.
+                                      */
+    unsigned int mg_selected_component;
 };
 
 //----------------------------------------------------------------------//
 template <typename number>
 inline void
-MGTransferSelect<number>::select(const unsigned int component)
+MGTransferSelect<number>::select(const unsigned int component,
+                                const unsigned int mg_component)
 {
   selected_component = component;
+  mg_selected_component = (mg_component == deal_II_numbers::invalid_unsigned_int)
+                         ? component
+                         : mg_component;
 }
 
 
index f2e6a3b2135bf1d5d3230022ca9e86a6c8bf91d0..fcc48e3cd0a5cd24afc481bd0b67b73140cf5916 100644 (file)
 
 
 
-template <typename number>
+template <class VECTOR>
 template <int dim, class InVector>
 void
-MGTransferPrebuilt<number>::copy_to_mg (
+MGTransferPrebuilt<VECTOR>::copy_to_mg (
   const MGDoFHandler<dim>        &mg_dof_handler,
-  MGLevelObject<Vector<number> > &dst,
+  MGLevelObject<VECTOR> &dst,
   const InVector                 &src) const
 {
                                   // forward to the correct
@@ -44,12 +44,12 @@ MGTransferPrebuilt<number>::copy_to_mg (
 }
 
 
-template <typename number>
+template <class VECTOR>
 template <int dim, class InVector>
 void
-MGTransferPrebuilt<number>::copy_to_mg (
+MGTransferPrebuilt<VECTOR>::copy_to_mg (
   const MGDoFHandler<dim>        &,
-  MGLevelObject<Vector<number> > &,
+  MGLevelObject<VECTOR> &,
   const InVector                 &,
   const is_1d<true>              &) const
 {
@@ -57,14 +57,14 @@ MGTransferPrebuilt<number>::copy_to_mg (
 }
 
 
-template <typename number>
+template <class VECTOR>
 template <int dim, class InVector>
 void
-MGTransferPrebuilt<number>::copy_to_mg (
-  const MGDoFHandler<dim>        &mg_dof_handler,
-  MGLevelObject<Vector<number> > &dst,
-  const InVector                 &src,
-  const is_1d<false>             &) const
+MGTransferPrebuilt<VECTOR>::copy_to_mg (
+  const MGDoFHandler<dim>mg_dof_handler,
+  MGLevelObject<VECTOR>& dst,
+  const InVector&          src,
+  const is_1d<false>&) const
 {
                                   // Make src a real finite element function
 //  InVector src = osrc;
@@ -81,8 +81,8 @@ MGTransferPrebuilt<number>::copy_to_mg (
 
   Assert(sizes.size()==mg_dof_handler.get_tria().n_levels(),
         ExcMatricesNotBuilt());
-  for (unsigned int l=minlevel;l<=maxlevel;++l)
-    dst[l].reinit(sizes[l]);
+//  for (unsigned int l=minlevel;l<=maxlevel;++l)
+//    dst[l].reinit(sizes[l]);
   
   std::vector<unsigned int> global_dof_indices (dofs_per_cell);
   std::vector<unsigned int> level_dof_indices  (dofs_per_cell);
@@ -158,13 +158,13 @@ MGTransferPrebuilt<number>::copy_to_mg (
 
 
 
-template <typename number>
+template <class VECTOR>
 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<VECTOR>::copy_from_mg(
+  const MGDoFHandler<dim>&       mg_dof_handler,
+  OutVector&                     dst,
+  const MGLevelObject<VECTOR>& src) const
 {
   const unsigned int dofs_per_cell = mg_dof_handler.get_fe().dofs_per_cell;
 
@@ -206,13 +206,13 @@ MGTransferPrebuilt<number>::copy_from_mg(
 
 
 
-template <typename number>
+template <class VECTOR>
 template <int dim, class OutVector>
 void
-MGTransferPrebuilt<number>::copy_from_mg_add (
+MGTransferPrebuilt<VECTOR>::copy_from_mg_add (
   const MGDoFHandler<dim>              &mg_dof_handler,
   OutVector                            &dst,
-  const MGLevelObject<Vector<number> > &src) const
+  const MGLevelObject<VECTOR> &src) const
 {
   const unsigned int dofs_per_cell = mg_dof_handler.get_fe().dofs_per_cell;
 
@@ -255,9 +255,9 @@ MGTransferPrebuilt<number>::copy_from_mg_add (
 }
 
 
-template <typename number>
+template <class VECTOR>
 unsigned int
-MGTransferPrebuilt<number>::memory_consumption () const
+MGTransferPrebuilt<VECTOR>::memory_consumption () const
 {
   unsigned int result = sizeof(*this);
   result += sizeof(unsigned int) * sizes.size();
@@ -288,7 +288,9 @@ MGTransferSelect<number>::copy_to_mg (
 {
                                   // forward to the correct
                                   // specialization
-  do_copy_to_mg (mg_dof_handler, dst, src, 0, is_1d<(dim==1)>());
+  do_copy_to_mg (mg_dof_handler, dst, src,
+                0, //component_start[selected_component],
+                is_1d<(dim==1)>());
 }
 
 
@@ -353,7 +355,8 @@ MGTransferSelect<number>::do_copy_to_mg (
   Assert(sizes.size()==mg_dof_handler.get_tria().n_levels(),
         ExcMatricesNotBuilt());
 
-  MGTools::reinit_vector(mg_dof_handler, dst, selected, mg_target_component);
+  MGTools::reinit_vector(mg_dof_handler, dst,
+                        mg_selected, mg_target_component);
   
   std::vector<unsigned int> global_dof_indices (dofs_per_cell);
   std::vector<unsigned int> level_dof_indices  (dofs_per_cell);
@@ -399,7 +402,7 @@ MGTransferSelect<number>::do_copy_to_mg (
            {
              const unsigned int component
                = mg_target_component[fe.system_to_component_index(i).first];
-             if (selected[component])
+             if (mg_selected[component])
                {
                  const unsigned int level_start
                    = mg_component_start[level][component];
@@ -409,13 +412,13 @@ MGTransferSelect<number>::do_copy_to_mg (
                }
            }
          
-         for (unsigned int face_n=0; face_n<GeometryInfo<dim>::faces_per_cell; ++face_n)
-           {
-             const typename MGDoFHandler<dim>::face_iterator
-               face = level_cell->face(face_n);
-             if (face->has_children())
-               {
-                 face->get_mg_dof_indices(level_face_indices);
+//       for (unsigned int face_n=0; face_n<GeometryInfo<dim>::faces_per_cell; ++face_n)
+//         {
+//           const typename MGDoFHandler<dim>::face_iterator
+//             face = level_cell->face(face_n);
+//           if (face->has_children())
+//             {
+//               face->get_mg_dof_indices(level_face_indices);
 
 
                                                   // Delete values on refinement edge,
@@ -423,9 +426,9 @@ MGTransferSelect<number>::do_copy_to_mg (
 //               for (unsigned int i=0; i<dofs_per_face; ++i)
 //                 dst[level](level_face_indices[i])
 //                   = 0.;
-               };
-           };
-       };
+//             };
+//         };
+       }
                                       // for that part of the level
                                       // which is further refined:
                                       // get the defect by
@@ -539,7 +542,7 @@ MGTransferSelect<number>::do_copy_from_mg (
        {
          const unsigned int component
            = mg_target_component[fe.system_to_component_index(i).first];
-       if (selected[component])
+       if (mg_selected[component])
          {
            const unsigned int level_start
              = mg_component_start[level][component];
@@ -602,7 +605,7 @@ MGTransferSelect<number>::do_copy_from_mg_add (
        {
          const unsigned int component
            = mg_target_component[fe.system_to_component_index(i).first];
-         if (selected[component])
+         if (mg_selected[component])
            {
              const unsigned int level_start
                = mg_component_start[level][component];
@@ -682,7 +685,7 @@ MGTransferBlock<number>::copy_to_mg (
   
   dst.clear();
 
-  MGTools::reinit_vector(mg_dof_handler, dst, selected, mg_target_component);
+  MGTools::reinit_vector(mg_dof_handler, dst, mg_selected, mg_target_component);
   
   std::vector<unsigned int> global_dof_indices (dofs_per_cell);
   std::vector<unsigned int> level_dof_indices  (dofs_per_cell);
index 0f5baed13adf3dcb5e892fc0b6d8ba5cc82d4389..1479067d357b9b35038008b69bca0027f95a5336 100644 (file)
  * Implementation of the multigrid method.
  *
  * Warning: multigrid on locally refined meshes only works with
- * discontinuous finite elements.
+ * <b>discontinuous finite elements</b> right now. It is not clear,
+ * whether the paradigm of local smoothing we use is applicable to
+ * continuous elements with hanging nodes; in fact, most people you
+ * meet on conferences seem to deny this.
  *
  * The function actually performing a multi-level cycle,
  * @p{level_mgstep}, as well as the function @p{vcycle}, calling it,
index 99ef32d7d4b18ac48688ff0e5675b568d7b0d6ac..0125fdbfe5b914f641f538775ff976c9935ec4d4 100644 (file)
@@ -61,7 +61,7 @@ void MGTransferBlockBase::build_matrices (
     {
       mg_target_component.resize(mg_dof.get_fe().n_components());
       for (unsigned int i=0;i<mg_target_component.size();++i)
-       mg_target_component[i] = i;
+       mg_target_component[i] = target_component[i];
     } else {
       Assert (mg_target_component.size() == mg_dof.get_fe().n_components(),
              ExcDimensionMismatch(mg_target_component.size(),
@@ -88,10 +88,10 @@ void MGTransferBlockBase::build_matrices (
   
                                   // Selected refers to the component
                                   // in mg_target_component.
-  selected = select;
+  mg_selected = select;
   
-  Assert (selected.size() == fe.n_components(),
-         ExcDimensionMismatch(selected.size(), fe.n_components()));
+  Assert (mg_selected.size() == fe.n_components(),
+         ExcDimensionMismatch(mg_selected.size(), fe.n_components()));
   
                                   // Compute the lengths of all blocks
   sizes.resize(n_levels);
@@ -242,7 +242,7 @@ void MGTransferBlockBase::build_matrices (
                          = fe.system_to_component_index(i).first;
                        const unsigned int jcomp
                          = fe.system_to_component_index(j).first;
-                       if ((icomp==jcomp) && selected[mg_target_component[icomp]])
+                       if ((icomp==jcomp) && mg_selected[mg_target_component[icomp]])
                          prolongation_sparsities[level]->add(dof_indices_child[i],
                                                              dof_indices_parent[j]);
                      };
@@ -278,7 +278,7 @@ void MGTransferBlockBase::build_matrices (
                      {
                        const unsigned int icomp = fe.system_to_component_index(i).first;
                        const unsigned int jcomp = fe.system_to_component_index(j).first;
-                       if ((icomp==jcomp) && selected[mg_target_component[icomp]])
+                       if ((icomp==jcomp) && mg_selected[mg_target_component[icomp]])
                          prolongation_matrices[level]->set(dof_indices_child[i],
                                                            dof_indices_parent[j],
                                                            prolongation(i,j));
@@ -351,14 +351,29 @@ void MGTransferSelect<number>::build_matrices (
 {
   unsigned int ncomp = mg_dof.get_fe().n_components();
   
-  selected_component = select;
-  std::vector<bool> s(ncomp, false);
-  s[mg_select] = true;
-//TODO:[GK] Assert that select and mg_select access the same component
-// or figure out how to use different components
   target_component = t_component;
   mg_target_component = mg_t_component;
   
+  selected_component = select;
+  mg_selected_component = mg_select;
+  selected.resize(ncomp, false);
+  selected[select] = true;
+                                  // If components are renumbered,
+                                  // find the first original
+                                  // component corresponding to the
+                                  // target component.
+  for (unsigned int i=0;i<target_component.size();++i)
+    {
+      if (target_component[i] == select)
+       {
+         selected_component = i;
+         break;
+       }
+    }
+    
+  std::vector<bool> s(ncomp, false);
+  s[mg_select] = true;
+
   MGTransferBlockBase::build_matrices (mg_dof, s);
 }
 
index 3720c4b34c93ba43bd5a29657351824b38528cd2..c754f2936c48b99d9094dcd3c97265e7543dc5a6 100644 (file)
@@ -169,82 +169,141 @@ void MGTransferPrebuilt<number>::build_matrices (
 
 
 template
-void MGTransferPrebuilt<float>::build_matrices<deal_II_dimension>
+void MGTransferPrebuilt<Vector<float> >::build_matrices<deal_II_dimension>
 (const MGDoFHandler<deal_II_dimension> &mg_dof);
 
 template
-void MGTransferPrebuilt<double>::build_matrices<deal_II_dimension>
+void MGTransferPrebuilt<Vector<double> >::build_matrices<deal_II_dimension>
+(const MGDoFHandler<deal_II_dimension> &mg_dof);
+
+template
+void MGTransferPrebuilt<BlockVector<float> >::build_matrices<deal_II_dimension>
+(const MGDoFHandler<deal_II_dimension> &mg_dof);
+
+template
+void MGTransferPrebuilt<BlockVector<double> >::build_matrices<deal_II_dimension>
 (const MGDoFHandler<deal_II_dimension> &mg_dof);
 
 template void
-MGTransferPrebuilt<float>::copy_to_mg (
+MGTransferPrebuilt<Vector<float> >::copy_to_mg (
   const MGDoFHandler<deal_II_dimension>&,
   MGLevelObject<Vector<float> >&,
   const Vector<double>&) const;
 template void
-MGTransferPrebuilt<float>::copy_to_mg (
+MGTransferPrebuilt<Vector<float> >::copy_to_mg (
   const MGDoFHandler<deal_II_dimension>&,
   MGLevelObject<Vector<float> >&,
   const BlockVector<double>&) const;
 template void
-MGTransferPrebuilt<float>::copy_to_mg (
+MGTransferPrebuilt<Vector<float> >::copy_from_mg (
   const MGDoFHandler<deal_II_dimension>&,
-  MGLevelObject<Vector<float> >&,
-  const Vector<float>&) const;
+  Vector<double>&,
+  const MGLevelObject<Vector<float> >&) const;
 template void
-MGTransferPrebuilt<float>::copy_to_mg (
+MGTransferPrebuilt<Vector<float> >::copy_from_mg (
   const MGDoFHandler<deal_II_dimension>&,
-  MGLevelObject<Vector<float> >&,
-  const BlockVector<float>&) const;
+  BlockVector<double>&,
+  const MGLevelObject<Vector<float> >&) const;
 template void
-MGTransferPrebuilt<float>::copy_from_mg (
+MGTransferPrebuilt<Vector<float> >::copy_from_mg_add (
   const MGDoFHandler<deal_II_dimension>&,
   Vector<double>&,
   const MGLevelObject<Vector<float> >&) const;
 template void
-MGTransferPrebuilt<float>::copy_from_mg (
+MGTransferPrebuilt<Vector<float> >::copy_from_mg_add (
   const MGDoFHandler<deal_II_dimension>&,
   BlockVector<double>&,
   const MGLevelObject<Vector<float> >&) const;
+
 template void
-MGTransferPrebuilt<float>::copy_from_mg (
+MGTransferPrebuilt<BlockVector<float> >::copy_to_mg (
   const MGDoFHandler<deal_II_dimension>&,
-  Vector<float>&,
-  const MGLevelObject<Vector<float> >&) const;
+  MGLevelObject<BlockVector<float> >&,
+  const Vector<double>&) const;
 template void
-MGTransferPrebuilt<float>::copy_from_mg (
+MGTransferPrebuilt<BlockVector<float> >::copy_to_mg (
   const MGDoFHandler<deal_II_dimension>&,
-  BlockVector<float>&,
-  const MGLevelObject<Vector<float> >&) const;
+  MGLevelObject<BlockVector<float> >&,
+  const BlockVector<double>&) const;
+template void
+MGTransferPrebuilt<BlockVector<float> >::copy_from_mg (
+  const MGDoFHandler<deal_II_dimension>&,
+  Vector<double>&,
+  const MGLevelObject<BlockVector<float> >&) const;
+template void
+MGTransferPrebuilt<BlockVector<float> >::copy_from_mg (
+  const MGDoFHandler<deal_II_dimension>&,
+  BlockVector<double>&,
+  const MGLevelObject<BlockVector<float> >&) const;
+template void
+MGTransferPrebuilt<BlockVector<float> >::copy_from_mg_add (
+  const MGDoFHandler<deal_II_dimension>&,
+  Vector<double>&,
+  const MGLevelObject<BlockVector<float> >&) const;
+template void
+MGTransferPrebuilt<BlockVector<float> >::copy_from_mg_add (
+  const MGDoFHandler<deal_II_dimension>&,
+  BlockVector<double>&,
+  const MGLevelObject<BlockVector<float> >&) const;
 
 template void
-MGTransferPrebuilt<double>::copy_to_mg (
+MGTransferPrebuilt<Vector<double> >::copy_to_mg (
   const MGDoFHandler<deal_II_dimension>&,
   MGLevelObject<Vector<double> >&,
   const Vector<double>&) const;
 template void
-MGTransferPrebuilt<double>::copy_to_mg (
+MGTransferPrebuilt<Vector<double> >::copy_to_mg (
   const MGDoFHandler<deal_II_dimension>&,
   MGLevelObject<Vector<double> >&,
   const BlockVector<double>&) const;
 template void
-MGTransferPrebuilt<double>::copy_from_mg (
+MGTransferPrebuilt<Vector<double> >::copy_from_mg (
   const MGDoFHandler<deal_II_dimension>&,
   Vector<double>&,
   const MGLevelObject<Vector<double> >&) const;
 template void
-MGTransferPrebuilt<double>::copy_from_mg (
+MGTransferPrebuilt<Vector<double> >::copy_from_mg (
   const MGDoFHandler<deal_II_dimension>&,
   BlockVector<double>&,
   const MGLevelObject<Vector<double> >&) const;
-
 template void
-MGTransferPrebuilt<double>::copy_from_mg_add (
+MGTransferPrebuilt<Vector<double> >::copy_from_mg_add (
   const MGDoFHandler<deal_II_dimension>&,
   Vector<double>&,
   const MGLevelObject<Vector<double> >&) const;
 template void
-MGTransferPrebuilt<double>::copy_from_mg_add (
+MGTransferPrebuilt<Vector<double> >::copy_from_mg_add (
   const MGDoFHandler<deal_II_dimension>&,
   BlockVector<double>&,
   const MGLevelObject<Vector<double> >&) const;
+
+template void
+MGTransferPrebuilt<BlockVector<double> >::copy_to_mg (
+  const MGDoFHandler<deal_II_dimension>&,
+  MGLevelObject<BlockVector<double> >&,
+  const Vector<double>&) const;
+template void
+MGTransferPrebuilt<BlockVector<double> >::copy_to_mg (
+  const MGDoFHandler<deal_II_dimension>&,
+  MGLevelObject<BlockVector<double> >&,
+  const BlockVector<double>&) const;
+template void
+MGTransferPrebuilt<BlockVector<double> >::copy_from_mg (
+  const MGDoFHandler<deal_II_dimension>&,
+  Vector<double>&,
+  const MGLevelObject<BlockVector<double> >&) const;
+template void
+MGTransferPrebuilt<BlockVector<double> >::copy_from_mg (
+  const MGDoFHandler<deal_II_dimension>&,
+  BlockVector<double>&,
+  const MGLevelObject<BlockVector<double> >&) const;
+template void
+MGTransferPrebuilt<BlockVector<double> >::copy_from_mg_add (
+  const MGDoFHandler<deal_II_dimension>&,
+  Vector<double>&,
+  const MGLevelObject<BlockVector<double> >&) const;
+template void
+MGTransferPrebuilt<BlockVector<double> >::copy_from_mg_add (
+  const MGDoFHandler<deal_II_dimension>&,
+  BlockVector<double>&,
+  const MGLevelObject<BlockVector<double> >&) const;
index 70ba223c790e9886b1fe20b1adffae598168cc96..18528d514fe6c09bb088ddd6ab4ad94e91b3be11 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal.II authors
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -90,16 +90,16 @@ Multigrid<VECTOR>::print_vector (const unsigned int level,
 
 
 
-template <typename number>
-MGTransferPrebuilt<number>::~MGTransferPrebuilt () 
+template <class VECTOR>
+MGTransferPrebuilt<VECTOR>::~MGTransferPrebuilt () 
 {}
 
 
-template <typename number>
-void MGTransferPrebuilt<number>::prolongate (
-  const unsigned int   to_level,
-  Vector<number>       &dst,
-  const Vector<number> &src) const 
+template <class VECTOR>
+void MGTransferPrebuilt<VECTOR>::prolongate (
+  const unsigned int to_level,
+  VECTOR&            dst,
+  const VECTOR&      src) const 
 {
   Assert ((to_level >= 1) && (to_level<=prolongation_matrices.size()),
          ExcIndexRange (to_level, 1, prolongation_matrices.size()+1));
@@ -108,11 +108,11 @@ void MGTransferPrebuilt<number>::prolongate (
 }
 
 
-template <typename number>
-void MGTransferPrebuilt<number>::restrict_and_add (
+template <class VECTOR>
+void MGTransferPrebuilt<VECTOR>::restrict_and_add (
   const unsigned int   from_level,
-  Vector<number>       &dst,
-  const Vector<number> &src) const 
+  VECTOR       &dst,
+  const VECTOR &src) const 
 {
   Assert ((from_level >= 1) && (from_level<=prolongation_matrices.size()),
          ExcIndexRange (from_level, 1, prolongation_matrices.size()+1));
@@ -185,8 +185,8 @@ void MGTransferSelect<number>::prolongate (
   Assert ((to_level >= 1) && (to_level<=prolongation_matrices.size()),
          ExcIndexRange (to_level, 1, prolongation_matrices.size()+1));
 
-      prolongation_matrices[to_level-1]->block(selected_component,
-                                              selected_component)
+      prolongation_matrices[to_level-1]->block(mg_selected_component,
+                                              mg_selected_component)
        .vmult (dst, src);
 }
 
@@ -200,8 +200,8 @@ void MGTransferSelect<number>::restrict_and_add (
   Assert ((from_level >= 1) && (from_level<=prolongation_matrices.size()),
          ExcIndexRange (from_level, 1, prolongation_matrices.size()+1));
 
-  prolongation_matrices[from_level-1]->block(selected_component,
-                                            selected_component)
+  prolongation_matrices[from_level-1]->block(mg_selected_component,
+                                            mg_selected_component)
     .Tvmult_add (dst, src);
 }
 
@@ -213,8 +213,10 @@ template class Multigrid<Vector<double> >;
 template class Multigrid<BlockVector<float> >;
 template class Multigrid<BlockVector<double> >;
 
-template class MGTransferPrebuilt<float>;
-template class MGTransferPrebuilt<double>;
+template class MGTransferPrebuilt<Vector<float> >;
+template class MGTransferPrebuilt<BlockVector<float> >;
+template class MGTransferPrebuilt<Vector<double> >;
+template class MGTransferPrebuilt<BlockVector<double> >;
 template class MGTransferBlock<float>;
 template class MGTransferBlock<double>;
 template class MGTransferSelect<float>;
index dc8798d19c4ef9fcf47946fab1220b3de16c6a52..1248c9a2943f2838ef69e84df052e4d045f48455 100644 (file)
@@ -2,7 +2,7 @@
 //    transfer.cc,v 1.4 2003/04/09 15:49:55 wolf Exp
 //    Version: 
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal.II authors
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -51,7 +51,7 @@ print_matrix(std::ostream& of,
   MGDoFHandler<dim> dof(tr);
   dof.distribute_dofs(finel);
 
-  MGTransferPrebuilt<double> transfer;
+  MGTransferPrebuilt<Vector<double> > transfer;
   transfer.build_matrices(dof);
 
   unsigned int n_coarse = dof.n_dofs(level-1);
index 6eba0bc4ff1ec4bbcab724bd5fc1cfddb50e9bdb..fd7a3ad31203e86b1f13b52938b427efbd31fe54 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003 by the deal.II authors
+//    Copyright (C) 2000, 2001, 2002, 2003, 2004 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -33,6 +33,7 @@
 #include <iomanip>
 #include <algorithm>
 
+using namespace std;
 
 template <int dim>
 void check_simple(const FiniteElement<dim>& fe)
@@ -46,7 +47,7 @@ void check_simple(const FiniteElement<dim>& fe)
   MGDoFHandler<dim> mgdof(tr);
   mgdof.distribute_dofs(fe);
 
-  MGTransferPrebuilt<double> transfer;
+  MGTransferPrebuilt<Vector<double> > transfer;
   transfer.build_matrices(mgdof);
 
   Vector<double> u2(mgdof.n_dofs(2));
@@ -71,8 +72,86 @@ void check_simple(const FiniteElement<dim>& fe)
 template <int dim>
 void check_select(const FiniteElement<dim>& fe,
                  unsigned int selected,
+                 unsigned int mg_selected,
                  std::vector<unsigned int> target_component,
                  std::vector<unsigned int> mg_target_component)
+{
+  deallog << fe.get_name()
+         << " select " << selected
+         << " (global) and " << mg_selected
+         << " (mg)" << std::endl;
+  
+  Triangulation<dim> tr;
+  GridGenerator::hyper_cube(tr);
+  tr.refine_global(2);
+  
+  MGDoFHandler<dim> mgdof(tr);
+  mgdof.distribute_dofs(fe);
+  DoFRenumbering::component_wise(mgdof, target_component);
+  vector<unsigned int> ndofs(fe.n_components());
+  DoFTools::count_dofs_per_component(mgdof, ndofs, target_component);
+  
+  for (unsigned int l=0;l<tr.n_levels();++l)
+    DoFRenumbering::component_wise(mgdof, l, mg_target_component);
+  std::vector<std::vector<unsigned int> > mg_ndofs(mgdof.get_tria().n_levels());  MGTools::count_dofs_per_component(mgdof, mg_ndofs, mg_target_component);
+
+  deallog << "Global  dofs:";
+  for (unsigned int i=0;i<ndofs.size();++i)
+    deallog << ' ' << ndofs[i];
+  deallog << std::endl;
+  for (unsigned int l=0;l<mg_ndofs.size();++l)
+    {
+      deallog << "Level " << l << " dofs:";
+      for (unsigned int i=0;i<mg_ndofs[l].size();++i)
+       deallog << ' ' << mg_ndofs[l][i];
+      deallog << std::endl;
+    }
+  
+  
+  MGTransferSelect<double> transfer;
+  transfer.build_matrices(mgdof, selected, mg_selected,
+                         target_component, mg_target_component);
+
+  Vector<double> u2(mg_ndofs[2][mg_selected]);
+  Vector<double> u1(mg_ndofs[1][mg_selected]);
+  Vector<double> u0(mg_ndofs[0][mg_selected]);
+
+  u0 = 1;
+  transfer.prolongate(1,u1,u0);
+  transfer.prolongate(2,u2,u1);
+  deallog << "u0 " << u0*u0
+         << "\tu1 " << u1*u1
+         << "\tu2 " << u2*u2;
+  u1 = 0.;
+  u0 = 0.;
+  transfer.restrict_and_add(2,u1,u2);
+  transfer.restrict_and_add(1,u0,u1);
+  deallog << "\tu1 " << u1*u1
+         << "\tu0 " << u0*u0
+         << std::endl;
+
+                                  // Check copy to mg and back
+  BlockVector<double> u;
+  u.reinit (ndofs);
+  for (unsigned int i=0;i<u.size();++i)
+    u(i) = i;
+  
+  MGLevelObject<Vector<double> > v;
+  v.resize(2,2);
+  v[2].reinit(mg_ndofs[2][mg_selected]);
+
+  transfer.copy_to_mg(mgdof, v, u);
+  for (unsigned int i=0; i<v[2].size();++i)
+    deallog << ' ' << (int) v[2](i);
+  deallog << std::endl;
+}
+
+template <int dim>
+void check_block(const FiniteElement<dim>& fe,
+                const vector<bool>& selected,
+                const vector<bool>& mg_selected,
+                std::vector<unsigned int> target_component,
+                std::vector<unsigned int> mg_target_component)
 {
   deallog << fe.get_name() << std::endl;
   
@@ -97,26 +176,26 @@ void check_select(const FiniteElement<dim>& fe,
     }
   
   
-  MGTransferSelect<double> transfer;
-  transfer.build_matrices(mgdof, selected, selected,
+  MGTransferBlock<double> transfer;
+  transfer.build_matrices(mgdof, selected, mg_selected,
                          target_component, mg_target_component);
 
-  Vector<double> u2(mg_ndofs[2][0]);
-  Vector<double> u1(mg_ndofs[1][0]);
-  Vector<double> u0(mg_ndofs[0][0]);
+  BlockVector<double> u2(mg_ndofs[2]);
+  BlockVector<double> u1(mg_ndofs[1]);
+  BlockVector<double> u0(mg_ndofs[0]);
 
   u0 = 1;
   transfer.prolongate(1,u1,u0);
   transfer.prolongate(2,u2,u1);
-  deallog << "u0 " << u0.l2_norm()
-         << "\tu1 " << u1.l2_norm()
-         << "\tu2 " << u2.l2_norm();
+  deallog << "u0 " << u0*u0
+         << "\tu1 " << u1*u1
+         << "\tu2 " << u2*u2;
   u1 = 0.;
   u0 = 0.;
   transfer.restrict_and_add(2,u1,u2);
   transfer.restrict_and_add(1,u0,u1);
-  deallog << "\tu1 " << u1.l2_norm()
-         << "\tu0 " << u0.l2_norm()
+  deallog << "\tu1 " << u1*u1
+         << "\tu0 " << u0*u0
          << std::endl;
 
                                   // Check copy to mg and back
@@ -129,7 +208,7 @@ void check_select(const FiniteElement<dim>& fe,
   
   MGLevelObject<Vector<double> > v;
   v.resize(2,2);
-  v[2].reinit(mg_ndofs[2][selected]);
+  v[2].reinit(mg_ndofs[2][mg_selected]);
 
   transfer.copy_to_mg(mgdof, v, u);
   for (unsigned int i=0; i<v[2].size();++i)
@@ -142,7 +221,7 @@ int main()
   std::ofstream logfile("transfer.output");
   logfile.precision(3);
   deallog.attach(logfile);
-  deallog.depth_console(0);
+  deallog.depth_console(10);
   
 //  check_simple (FE_DGP<2>(0));
 //  check_simple (FE_DGP<2>(1));
@@ -151,6 +230,8 @@ int main()
 //  check_simple (FE_Q<2>(1));
 //  check_simple (FE_Q<2>(2));
 
+  std::cerr << "Select" << std::endl;
+  
   std::vector<unsigned int> v1(4);
   std::vector<unsigned int> v2(4);
   std::vector<unsigned int> v3(4);
@@ -158,17 +239,29 @@ int main()
     {
       v1[i] = i;
       v2[i] = 0;
-      v3[i] = i/2;
+      v3[i] = i;
     }
-  
-  check_select (FESystem<2>(FE_DGQ<2>(1), 4), 0, v1, v1);
-  check_select (FESystem<2>(FE_DGQ<2>(1), 4), 1, v1, v1);
-  check_select (FESystem<2>(FE_DGQ<2>(1), 4), 0, v2, v2);
-  check_select (FESystem<2>(FE_DGQ<2>(1), 4), 0, v3, v3);
-  check_select (FESystem<2>(FE_DGQ<2>(1), 4), 1, v3, v3);
-  check_select (FESystem<2>(FE_DGQ<2>(1), 4), 0, v1, v3);
-  check_select (FESystem<2>(FE_DGQ<2>(1), 4), 1, v1, v3);
-}
+  v3[0] = 0;
+  v3[1] = 1;
+  v3[2] = 1;
+  v3[3] = 2;
 
+  FESystem<2> fe1(FE_DGQ<2>(1), 4);
+  
+  check_select (fe1, 0, 0, v1, v1);
+  check_select (fe1, 1, 1, v1, v1);
+  check_select (fe1, 1, 2, v1, v1);
+  check_select (fe1, 2, 1, v1, v1);
+  check_select (fe1, 0, 0, v2, v2);
+  check_select (fe1, 0, 0, v3, v3);
+  check_select (fe1, 1, 1, v3, v3);
+  check_select (fe1, 0, 0, v1, v3);
+  check_select (fe1, 1, 1, v1, v3);
+  check_select (fe1, 2, 1, v1, v3);
+  check_select (fe1, 0, 1, v1, v3);
+  check_select (fe1, 0, 0, v1, v2);
 
+//  vector<bool> s1(4, true);
 
+//  check_block(fe1, s1, s1, v1, v1);
+}

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.