]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
untested (and unaccessed) code for easy matrices
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 7 Mar 2003 11:17:57 +0000 (11:17 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 7 Mar 2003 11:17:57 +0000 (11:17 +0000)
git-svn-id: https://svn.dealii.org/trunk@7275 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/multigrid/mg_transfer.h
deal.II/deal.II/source/multigrid/multigrid.cc

index 1b234e5906a807beab3911bb7db9578925b76625..b7bb6d19f97e48ed674a7b91f3233da359c32438 100644 (file)
 #define __deal2__mg_transfer_h
 
 
-#include <lac/sparsity_pattern.h>
 #include <lac/block_vector.h>
-#include <lac/block_sparsity_pattern.h>
+#ifdef DEAL_PREFER_MATRIX_EZ
+#  include <lac/sparse_matrix_ez.h>
+#  include <lac/block_sparse_matrix_ez.h>
+#else
+#  include <lac/sparsity_pattern.h>
+#  include <lac/block_sparsity_pattern.h>
+#endif
 #include <multigrid/mg_base.h>
 #include <multigrid/mg_level_object.h>
 
@@ -165,7 +170,21 @@ class MGTransferPrebuilt : public MGTransferBase<Vector<number> >
                                    */
     std::vector<unsigned int> sizes;
 
-
+#ifdef DEAL_PREFER_MATRIX_EZ
+                                    /**
+                                     * The actual prolongation matrix.
+                                     * column indices belong to the
+                                     * dof indices of the mother cell,
+                                     * i.e. the coarse level.
+                                     * while row indices belong to the
+                                     * child cell, i.e. the fine level.
+                                     */
+    std::vector<SparseMatrixEZ<double> > prolongation_matrices;
+#else
+                                    /**
+                                     * Sparsity patterns for transfer
+                                     * matrices.
+                                     */
     std::vector<SparsityPattern>   prolongation_sparsities;
 
                                     /**
@@ -177,6 +196,7 @@ class MGTransferPrebuilt : public MGTransferBase<Vector<number> >
                                      * child cell, i.e. the fine level.
                                      */
     std::vector<SparseMatrix<double> > prolongation_matrices;
+#endif
 };
 
 
index 5cdce035772a7d6e13fcd15f36ba955f12da2c9f..0491b8132e17836f2f5b33b55cc834561d000904 100644 (file)
@@ -51,9 +51,10 @@ void MGTransferPrebuilt<number>::build_matrices (
                                   // have a size greater zero.
   prolongation_matrices.resize (0);
   prolongation_matrices.resize (n_levels-1);
+#ifndef DEAL_PREFER_MATRIX_EZ
   prolongation_sparsities.resize (0);
   prolongation_sparsities.resize (n_levels-1);
-
+#endif
                                   // two fields which will store the
                                   // indices of the multigrid dofs
                                   // for a cell and one of its children
@@ -74,10 +75,18 @@ void MGTransferPrebuilt<number>::build_matrices (
                                       // necessary. this, of course, is the
                                       // number of degrees of freedom per
                                       // cell
+#ifdef DEAL_PREFER_MATRIX_EZ      
+      prolongation_matrices[level].reinit (sizes[level+1],
+                                          sizes[level],
+                                          dofs_per_cell);
+#else
+                                      // increment dofs_per_cell
+                                      // since a useless diagonal
+                                      // element will be stored
       prolongation_sparsities[level].reinit (sizes[level+1],
-                                             sizes[level],
-//TODO:[WB,GK] evil hack, must be corrected!
-                                             dofs_per_cell+1);
+                                            sizes[level],
+                                            dofs_per_cell+1);
+#endif
       
       for (typename MGDoFHandler<dim>::cell_iterator cell=mg_dof.begin(level);
           cell != mg_dof.end(level); ++cell)

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.