]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Initial version of the prebuilt MGTransfer class. May or may not work.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 8 Apr 1999 16:15:17 +0000 (16:15 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 8 Apr 1999 16:15:17 +0000 (16:15 +0000)
git-svn-id: https://svn.dealii.org/trunk@1104 0785d39b-7218-0410-832d-ea1e28bc413d

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

index f9c6b52f2cf09d40f7e6225eb2d73944d1e8371a..7d60d21d34d548d5e498e611d0b574d9bf73e5ee 100644 (file)
@@ -277,9 +277,9 @@ class MGTransferPrebuilt : public MGTransferBase
                                      * are degrees of freedom on the finer
                                      * level.
                                      */
-    virtual void prolongate (const unsigned int  to_level,
+    virtual void prolongate (const unsigned int   to_level,
                             Vector<float>       &dst,
-                            const Vector<float> &src) const = 0;
+                            const Vector<float> &src) const;
 
                                     /**
                                      * Restrict a vector from level
@@ -296,7 +296,7 @@ class MGTransferPrebuilt : public MGTransferBase
                                      */
     virtual void restrict (const unsigned int   from_level,
                           Vector<float>       &dst,
-                          const Vector<float> &src) const = 0;
+                          const Vector<float> &src) const;
 
   private:
 
index f9c6b52f2cf09d40f7e6225eb2d73944d1e8371a..7d60d21d34d548d5e498e611d0b574d9bf73e5ee 100644 (file)
@@ -277,9 +277,9 @@ class MGTransferPrebuilt : public MGTransferBase
                                      * are degrees of freedom on the finer
                                      * level.
                                      */
-    virtual void prolongate (const unsigned int  to_level,
+    virtual void prolongate (const unsigned int   to_level,
                             Vector<float>       &dst,
-                            const Vector<float> &src) const = 0;
+                            const Vector<float> &src) const;
 
                                     /**
                                      * Restrict a vector from level
@@ -296,7 +296,7 @@ class MGTransferPrebuilt : public MGTransferBase
                                      */
     virtual void restrict (const unsigned int   from_level,
                           Vector<float>       &dst,
-                          const Vector<float> &src) const = 0;
+                          const Vector<float> &src) const;
 
   private:
 
index 0def1ffacaebc34d90e6a1d277327b1bcd796fa2..c51528c279fd89239b3eab39b92c543eee6d2015 100644 (file)
@@ -82,7 +82,7 @@ MGTransferBase::~MGTransferBase ()
 /* ----------------------------- MGTransferPrebuilt ------------------------ */
 
 
-/*
+
 MGTransferPrebuilt::~MGTransferPrebuilt () 
 {};
 
@@ -148,7 +148,8 @@ void MGTransferPrebuilt::build_matrices (const MGDoFHandler<dim> &mg_dof)
              };
          };
 
-      prolongation_matrices[level].matrix.reinit (prolongation_matrices[level].sparsity);
+      prolongation_matrices.push_back (SparseMatrix<float>());
+      prolongation_matrices[level].reinit (prolongation_sparsities[level]);
 
 
                                       // now actually build the matrices
@@ -175,7 +176,7 @@ void MGTransferPrebuilt::build_matrices (const MGDoFHandler<dim> &mg_dof)
                  for (unsigned int j=0; j<dofs_per_cell; ++j)
                    if (prolongation(i,j) != 0)
                      {
-                       prolongation_matrices[level]
+                       prolongation_matrices[level].set
                          (dof_indices_child[i],
                           dof_indices_mother[j],
                           prolongation(i,j));
@@ -187,10 +188,32 @@ void MGTransferPrebuilt::build_matrices (const MGDoFHandler<dim> &mg_dof)
 
 
 
+void MGTransferPrebuilt::prolongate (const unsigned int   to_level,
+                                    Vector<float>       &dst,
+                                    const Vector<float> &src) const 
+{
+  Assert ((to_level >= 1) && (to_level<prolongation_matrices.size()-1),
+         ExcIndexRange (to_level, 1, prolongation_matrices.size()-1));
+
+  prolongation_matrices[to_level-1].vmult (dst, src);
+};
+
+
+
+void MGTransferPrebuilt::restrict (const unsigned int   from_level,
+                                  Vector<float>       &dst,
+                                  const Vector<float> &src) const 
+{
+  Assert ((from_level >= 1) && (from_level<prolongation_matrices.size()-1),
+         ExcIndexRange (from_level, 1, prolongation_matrices.size()-1));
+
+  prolongation_matrices[from_level-1].Tvmult (dst, src);
+};
+
 
 
 // explicit instatations
 template
 void MGTransferPrebuilt::build_matrices (const MGDoFHandler<deal_II_dimension> &mg_dof);
 
-*/
+
index 0def1ffacaebc34d90e6a1d277327b1bcd796fa2..c51528c279fd89239b3eab39b92c543eee6d2015 100644 (file)
@@ -82,7 +82,7 @@ MGTransferBase::~MGTransferBase ()
 /* ----------------------------- MGTransferPrebuilt ------------------------ */
 
 
-/*
+
 MGTransferPrebuilt::~MGTransferPrebuilt () 
 {};
 
@@ -148,7 +148,8 @@ void MGTransferPrebuilt::build_matrices (const MGDoFHandler<dim> &mg_dof)
              };
          };
 
-      prolongation_matrices[level].matrix.reinit (prolongation_matrices[level].sparsity);
+      prolongation_matrices.push_back (SparseMatrix<float>());
+      prolongation_matrices[level].reinit (prolongation_sparsities[level]);
 
 
                                       // now actually build the matrices
@@ -175,7 +176,7 @@ void MGTransferPrebuilt::build_matrices (const MGDoFHandler<dim> &mg_dof)
                  for (unsigned int j=0; j<dofs_per_cell; ++j)
                    if (prolongation(i,j) != 0)
                      {
-                       prolongation_matrices[level]
+                       prolongation_matrices[level].set
                          (dof_indices_child[i],
                           dof_indices_mother[j],
                           prolongation(i,j));
@@ -187,10 +188,32 @@ void MGTransferPrebuilt::build_matrices (const MGDoFHandler<dim> &mg_dof)
 
 
 
+void MGTransferPrebuilt::prolongate (const unsigned int   to_level,
+                                    Vector<float>       &dst,
+                                    const Vector<float> &src) const 
+{
+  Assert ((to_level >= 1) && (to_level<prolongation_matrices.size()-1),
+         ExcIndexRange (to_level, 1, prolongation_matrices.size()-1));
+
+  prolongation_matrices[to_level-1].vmult (dst, src);
+};
+
+
+
+void MGTransferPrebuilt::restrict (const unsigned int   from_level,
+                                  Vector<float>       &dst,
+                                  const Vector<float> &src) const 
+{
+  Assert ((from_level >= 1) && (from_level<prolongation_matrices.size()-1),
+         ExcIndexRange (from_level, 1, prolongation_matrices.size()-1));
+
+  prolongation_matrices[from_level-1].Tvmult (dst, src);
+};
+
 
 
 // explicit instatations
 template
 void MGTransferPrebuilt::build_matrices (const MGDoFHandler<deal_II_dimension> &mg_dof);
 
-*/
+

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.