]> https://gitweb.dealii.org/ - dealii.git/commitdiff
SparseMatrixEZ use removed
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Sun, 22 Jan 2006 18:55:11 +0000 (18:55 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Sun, 22 Jan 2006 18:55:11 +0000 (18:55 +0000)
git-svn-id: https://svn.dealii.org/trunk@12118 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 6dc0a77c958adeda99affa9875b09998e524c700..f12d288370442d4f5df6a8cb21b0c28fd2cab338 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2003, 2004, 2005 by the deal.II authors
+//    Copyright (C) 2003, 2004, 2005, 2006 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -145,21 +145,14 @@ void MGTransferBlockBase::build_matrices (
                                   // deleting the object it points to
                                   // by itself
   prolongation_matrices.resize (0);
-#ifndef DEAL_PREFER_MATRIX_EZ
   prolongation_sparsities.resize (0);
-#endif
 
   for (unsigned int i=0; i<n_levels-1; ++i)
     {
-#ifndef DEAL_PREFER_MATRIX_EZ
       prolongation_sparsities
        .push_back (boost::shared_ptr<BlockSparsityPattern> (new BlockSparsityPattern));
       prolongation_matrices
        .push_back (boost::shared_ptr<BlockSparseMatrix<double> > (new BlockSparseMatrix<double>));
-#else
-      prolongation_matrices
-       .push_back (boost::shared_ptr<BlockSparseMatrix<double> > (new BlockSparseMatrixEZ<double>));
-#endif
     }
 
                                   // two fields which will store the
@@ -185,26 +178,6 @@ void MGTransferBlockBase::build_matrices (
                                       // is necessary. this, is the
                                       // number of degrees of freedom
                                       // per cell
-#ifdef DEAL_PREFER_MATRIX_EZ
-//TODO:[GK] Optimize here: 
-// this allocates too much memory, since the cell matrices contain
-// many zeroes. If SparseMatrixEZ::reinit can handle a vector of
-// row-lengths, this should be used here to specify the length of
-// every single row.
-
-      prolongation_matrices[level]->reinit (n_components, n_components);
-      for (unsigned int i=0;i<n_components;++i)
-       for (unsigned int j=0;j<n_components;++j)
-         if (i==j)
-           prolongation_matrices[level]->block(i,j)
-             .reinit(sizes[level+1][i],
-                     sizes[level][j], dofs_per_cell, 0);
-         else
-           prolongation_matrices[level]->block(i,j)
-             .reinit(sizes[level+1][i],
-                     sizes[level][j], 0);
-      prolongation_matrices[level]->collect_sizes();
-#else
       prolongation_sparsities[level]->reinit (n_components, n_components);
       for (unsigned int i=0; i<n_components; ++i)
        for (unsigned int j=0; j<n_components; ++j)
@@ -258,7 +231,6 @@ void MGTransferBlockBase::build_matrices (
       prolongation_sparsities[level]->compress ();
 
       prolongation_matrices[level]->reinit (*prolongation_sparsities[level]);
-#endif
                                       // now actually build the matrices
       for (typename MGDoFHandler<dim>::cell_iterator cell=mg_dof.begin(level);
           cell != mg_dof.end(level); ++cell)
@@ -289,48 +261,13 @@ void MGTransferBlockBase::build_matrices (
                          prolongation_matrices[level]->set(dof_indices_child[i],
                                                            dof_indices_parent[j],
                                                            prolongation(i,j));
-                     };
-             };
-         };
-    };
-#if defined(DEAL_PREFER_MATRIX_EZ) && 1 == 0
-  deallog.push("Transfer");
-  for (unsigned int level=0;level<n_levels-1; ++level)
-    for (unsigned int i=0;i<n_components;++i)
-      for (unsigned int j=0;j<n_components;++j)
-       {
-         deallog << "level " << level
-                 << " block " << i << ' ' << j << std::endl;
-         
-         prolongation_matrices[level]->block(i,j).print_statistics(deallog,true);
-       }
-  deallog.pop();
-#endif  
-}
-
-
-//TODO[GK]: the following function needs to be in mg_transfer_base.all_dimensions.cc
-//TODO:[GK] Add all those little vectors.
-unsigned int
-MGTransferBlockBase::memory_consumption () const
-{
-  unsigned int result = sizeof(*this);
-  result += sizeof(unsigned int) * sizes.size();
-#ifdef DEAL_PREFER_MATRIX_EZ
-  std::vector<boost::shared_ptr<SparseMatrixEZ<double> > >::const_iterator m;
-  const std::vector<boost::shared_ptr<SparseMatrixEZ<double> > >::const_iterator end = prolongation_matrices.end();
-  for (m = prolongation_matrices.begin(); m != end ; ++m)
-    result += *m->memory_consumption();
-#else
-  for (unsigned int i=0;i<prolongation_matrices.size();++i)
-    result += prolongation_matrices[i]->memory_consumption()
-             + prolongation_sparsities[i]->memory_consumption();
-#endif
-  return result;
+                     }
+             }
+         }
+    }
 }
 
 
-
 template <typename number>
 template <int dim>
 void MGTransferBlock<number>::build_matrices (
index 0cc34d8cb8cafb363ed8244ed7d8d7e52de75f28..42f06b0f8449659f44459335eaaead1f948db777 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2003, 2004, 2005 by the deal.II authors
+//    Copyright (C) 2003, 2004, 2005, 2006 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -50,21 +50,14 @@ void MGTransferPrebuilt<number>::build_matrices (
                                   // deleting the object it points to
                                   // by itself
   prolongation_matrices.resize (0);
-#ifndef DEAL_PREFER_MATRIX_EZ
   prolongation_sparsities.resize (0);
-#endif
-
+  
   for (unsigned int i=0; i<n_levels-1; ++i)
     {
-#ifndef DEAL_PREFER_MATRIX_EZ
       prolongation_sparsities
        .push_back (boost::shared_ptr<SparsityPattern> (new SparsityPattern));
       prolongation_matrices
        .push_back (boost::shared_ptr<SparseMatrix<double> > (new SparseMatrix<double>));
-#else
-      prolongation_matrices
-       .push_back (boost::shared_ptr<SparseMatrix<double> > (new SparseMatrixEZ<double>));
-#endif
     }
   
                                   // two fields which will store the
@@ -87,11 +80,6 @@ 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
@@ -133,7 +121,6 @@ void MGTransferPrebuilt<number>::build_matrices (
       prolongation_sparsities[level]->compress ();
 
       prolongation_matrices[level]->reinit (*prolongation_sparsities[level]);
-#endif
 
                                       // now actually build the matrices
       for (typename MGDoFHandler<dim>::cell_iterator cell=mg_dof.begin(level);
index a4204673e9698fabbcc7012f3874ac241d2ee379..1772228711c9ff137ca7b6f815a440dfc9df2111 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors
+//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -208,6 +208,20 @@ void MGTransferBlock<number>::restrict_and_add (
 
 
 
+//TODO:[GK] Add all those little vectors.
+unsigned int
+MGTransferBlockBase::memory_consumption () const
+{
+  unsigned int result = sizeof(*this);
+  result += sizeof(unsigned int) * sizes.size();
+  for (unsigned int i=0;i<prolongation_matrices.size();++i)
+    result += prolongation_matrices[i]->memory_consumption()
+             + prolongation_sparsities[i]->memory_consumption();
+  return result;
+}
+
+
+//----------------------------------------------------------------------//
 
 template <typename number>
 MGTransferSelect<number>::~MGTransferSelect () 

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.