From d0525d3418526cfbb198a6593ef74b383182aaab Mon Sep 17 00:00:00 2001 From: janssen Date: Tue, 9 Feb 2010 08:50:39 +0000 Subject: [PATCH] put some output to debug>3 git-svn-id: https://svn.dealii.org/trunk@20524 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/multigrid/multigrid.h | 18 ++++++++++++++++++ .../include/multigrid/multigrid.templates.h | 6 +++--- .../source/multigrid/mg_transfer_component.cc | 19 +++++++++++++++---- .../source/multigrid/mg_transfer_prebuilt.cc | 4 ++-- .../multigrid/multigrid.all_dimensions.cc | 19 +++++++++++++++---- 5 files changed, 53 insertions(+), 13 deletions(-) diff --git a/deal.II/deal.II/include/multigrid/multigrid.h b/deal.II/deal.II/include/multigrid/multigrid.h index 15050e2412..097526fcd9 100644 --- a/deal.II/deal.II/include/multigrid/multigrid.h +++ b/deal.II/deal.II/include/multigrid/multigrid.h @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -670,6 +671,23 @@ PreconditionMG::vmult ( transfer->copy_from_mg(*mg_dof_handler, dst, multigrid->solution); + + /* + DataOut data_out; + data_out.attach_dof_handler (*mg_dof_handler); + VECTOR2 tmp; + tmp.reinit(dst); + tmp = dst; + transfer->constraints->distribute(tmp); + data_out.add_data_vector (tmp, "mg"); + data_out.build_patches (); + + std::ostringstream filename; + filename << "mg.gpl"; + + std::ofstream output (filename.str().c_str()); + data_out.write_gnuplot (output); + */ } diff --git a/deal.II/deal.II/include/multigrid/multigrid.templates.h b/deal.II/deal.II/include/multigrid/multigrid.templates.h index 99a99a3cb3..01e8f6881e 100644 --- a/deal.II/deal.II/include/multigrid/multigrid.templates.h +++ b/deal.II/deal.II/include/multigrid/multigrid.templates.h @@ -176,10 +176,10 @@ Multigrid::level_v_step(const unsigned int level) edge_down->vmult(level, t[level-1], solution[level]); transfer->restrict_and_add (l, t[l-1], t[l]); - if(debug>2) + if(debug>3) deallog << "restrict t[" << l-1 << "] " << t[l-1].l2_norm() << std::endl; defect[l-1] -= t[l-1]; - if(debug>2) + if(debug>3) deallog << "defect d[" << l-1 << "] " << defect[l-1].l2_norm() << std::endl; } @@ -211,7 +211,7 @@ Multigrid::level_v_step(const unsigned int level) } if (debug>2) - deallog << "V-cycle Defect norm hier " << defect[level].l2_norm() + deallog << "V-cycle Defect norm " << defect[level].l2_norm() << std::endl; if (debug>1) diff --git a/deal.II/deal.II/source/multigrid/mg_transfer_component.cc b/deal.II/deal.II/source/multigrid/mg_transfer_component.cc index 26d2891c86..c30c638a8a 100644 --- a/deal.II/deal.II/source/multigrid/mg_transfer_component.cc +++ b/deal.II/deal.II/source/multigrid/mg_transfer_component.cc @@ -635,16 +635,27 @@ void MGTransferSelect::build_matrices ( for (unsigned int i=0; i::copy_to_mg ( for (unsigned int level=mg_dof_handler.get_tria().n_levels();level != 0;) { --level; - VECTOR& dst_level = dst[level]; +// VECTOR& dst_level = dst[level]; typedef std::map::const_iterator IT; for (IT i= copy_indices[level].begin(); i != copy_indices[level].end();++i) - dst_level(i->second) = src(i->first); + dst[level](i->second) = src(i->first); // For non-DG: degrees of // freedom in the refinement diff --git a/deal.II/deal.II/source/multigrid/multigrid.all_dimensions.cc b/deal.II/deal.II/source/multigrid/multigrid.all_dimensions.cc index b7508931f8..134df115ab 100644 --- a/deal.II/deal.II/source/multigrid/multigrid.all_dimensions.cc +++ b/deal.II/deal.II/source/multigrid/multigrid.all_dimensions.cc @@ -283,6 +283,17 @@ MGTransferBlockBase::memory_consumption () const //----------------------------------------------------------------------// +template +MGTransferSelect::MGTransferSelect () +{} + + +template +MGTransferSelect::MGTransferSelect (const ConstraintMatrix &c) + : + constraints(&c) +{} + template MGTransferSelect::~MGTransferSelect () {} @@ -297,8 +308,8 @@ void MGTransferSelect::prolongate ( Assert ((to_level >= 1) && (to_level<=prolongation_matrices.size()), ExcIndexRange (to_level, 1, prolongation_matrices.size()+1)); - prolongation_matrices[to_level-1]->block(mg_selected_component, - mg_selected_component) + prolongation_matrices[to_level-1]->block(mg_target_component[mg_selected_component], + mg_target_component[mg_selected_component]) .vmult (dst, src); } @@ -312,8 +323,8 @@ void MGTransferSelect::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(mg_selected_component, - mg_selected_component) + prolongation_matrices[from_level-1]->block(mg_target_component[mg_selected_component], + mg_target_component[mg_selected_component]) .Tvmult_add (dst, src); } -- 2.39.5