]> https://gitweb.dealii.org/ - dealii.git/commitdiff
added a clear function to mg_smoother and some bugs fixed
authorBaerbel Jannsen <baerbel.janssen@gmail.com>
Mon, 22 Mar 2010 15:07:17 +0000 (15:07 +0000)
committerBaerbel Jannsen <baerbel.janssen@gmail.com>
Mon, 22 Mar 2010 15:07:17 +0000 (15:07 +0000)
git-svn-id: https://svn.dealii.org/trunk@20878 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/multigrid/mg_smoother.h
deal.II/deal.II/include/multigrid/mg_transfer.templates.h
deal.II/deal.II/include/multigrid/mg_transfer_component.templates.h
deal.II/deal.II/include/multigrid/multigrid.h

index e28f7cd486c706b1b251f212c4f619eab14e292b..5d9743a492675569e1451eeaca9c7aada2924de3 100644 (file)
@@ -163,6 +163,7 @@ class MGSmootherIdentity : public MGSmootherBase<VECTOR>
     virtual void smooth (const unsigned int level,
                         VECTOR&            u,
                         const VECTOR&      rhs) const;
+    virtual void clear ();
 };
 
 
@@ -525,6 +526,11 @@ MGSmootherIdentity<VECTOR>::smooth (
   const VECTOR&) const
 {}
 
+template <class VECTOR>
+inline void
+MGSmootherIdentity<VECTOR>::clear () 
+{}
+
 //---------------------------------------------------------------------------
 
 template <class VECTOR>
index 0aad386f8bf329405931975ccbad5769f620cb52..5e8209166260d6eec2019b96c95c8e8b541713ce 100644 (file)
@@ -50,6 +50,7 @@ MGTransferPrebuilt<VECTOR>::copy_from_mg(
   for (unsigned int level=0;level<mg_dof_handler.get_tria().n_levels();++level)
   {
     typedef std::vector<std::pair<unsigned int, unsigned int> >::const_iterator IT;
+
     for (IT i= copy_indices[level].begin();
         i != copy_indices[level].end();++i)
       dst(i->first) = src[level](i->second);
index a8abc206256eceb3bf03cab77b9537def5d83d9c..2902b33e99a705a542f59700520e292e78206f8f 100644 (file)
@@ -68,7 +68,9 @@ MGTransferSelect<number>::copy_from_mg (
   BlockVector<number2>&                 dst,
   const MGLevelObject<Vector<number> >& src) const
 {
-  do_copy_from_mg (mg_dof_handler, dst, src);
+  dst = 0;
+  do_copy_from_mg (mg_dof_handler,
+      dst.block(target_component[selected_component]), src);
   if (constraints != 0)
     constraints->condense(dst);
 }
@@ -83,6 +85,7 @@ MGTransferSelect<number>::copy_from_mg (
   Vector<number2>&                      dst,
   const MGLevelObject<Vector<number> >& src) const
 {
+  dst = 0;
   do_copy_from_mg (mg_dof_handler, dst, src);
   if (constraints != 0)
   {
index fbcccdce6bcfd69dce042c9d13079665813590e4..9ffeddc4b0af45b5616900ab7ceaa1c8db6cc011 100644 (file)
@@ -664,7 +664,7 @@ PreconditionMG<dim, VECTOR, TRANSFER>::vmult (
   VECTOR2& dst,
   const VECTOR2& src) const
 {
-#ifdef baerbel_mg_test
+#ifdef BAERBEL_MG_TEST
   const unsigned int min_l = multigrid->solution.get_minlevel();
   const unsigned int max_l = multigrid->solution.get_maxlevel();
   deallog << "PreconditionMG in " << src.l2_norm() << std::endl;
@@ -672,22 +672,22 @@ PreconditionMG<dim, VECTOR, TRANSFER>::vmult (
   transfer->copy_to_mg(*mg_dof_handler,
                       multigrid->defect,
                       src);
-#ifdef baerbel_mg_test
+#ifdef BAERBEL_MG_TEST
   for(unsigned int l=min_l; l<max_l; ++l)
   deallog << "defect [" << l << "] " << multigrid->defect[l].l2_norm() << std::endl;
 #endif
   multigrid->cycle();
 
-#ifdef baerbel_mg_test
+#ifdef BAERBEL_MG_TEST
   for(unsigned int l=min_l; l<max_l; ++l)
   deallog << "solution [" << l << "] " << multigrid->solution[l].l2_norm() << std::endl;
 #endif
   transfer->copy_from_mg(*mg_dof_handler,
                         dst,
                         multigrid->solution);
-#ifdef baerbel_mg_test
+#ifdef BAERBEL_MG_TEST
   deallog << "PreconditionMG out " << dst.l2_norm() << std::endl;
-#endif
+
   /*
   DataOut<dim> data_out;
   data_out.attach_dof_handler (*mg_dof_handler);
@@ -704,6 +704,7 @@ PreconditionMG<dim, VECTOR, TRANSFER>::vmult (
   std::ofstream output (filename.str().c_str());
   data_out.write_gnuplot (output);
   */
+#endif
 }
 
 

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

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.