From: Guido Kanschat Date: Sun, 3 Jan 2010 15:52:10 +0000 (+0000) Subject: new multigrid X-Git-Tag: v8.0.0~6714 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e12993cd612193bf568ee3f0cc1393d47360e785;p=dealii.git new multigrid git-svn-id: https://svn.dealii.org/trunk@20275 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/multigrid/mg_smoother.h b/deal.II/deal.II/include/multigrid/mg_smoother.h index ff47759bef..ef498eed7a 100644 --- a/deal.II/deal.II/include/multigrid/mg_smoother.h +++ b/deal.II/deal.II/include/multigrid/mg_smoother.h @@ -166,115 +166,6 @@ class MGSmootherIdentity : public MGSmootherBase }; -/** - * Base class for multigrid smoothers. It implements some - * functionality for setting the values of vectors at interior - * boundaries (i.e. boundaries between differing levels of the - * triangulation) to zero, by building a list of these degrees of - * freedom's indices at construction time. - * - * @author Wolfgang Bangerth, Guido Kanschat, 1999, 2002 - */ -template -class MGSmootherContinuous : public MGSmootherBase -{ - private: - /** - * Default constructor. Made private - * to prevent it being called, which - * is necessary since this could - * circumvent the set-up of the list - * if interior boundary dofs. - */ - MGSmootherContinuous (); - - public: - - /** - * Constructor. This one collects - * the indices of the degrees of freedom - * on the interior boundaries between - * the different levels, which are - * needed by the function - * @p set_zero_interior_boundaries. - * - * Since this function is - * implemented a bit different in - * 1d (there are no faces of - * cells, just vertices), there - * are actually two sets of - * constructors, namely this one - * for 1d and the following one - * for all other - * dimensions. Really amusing - * about this text is, that there - * is no 1d implementation. - */ - MGSmootherContinuous (const MGDoFHandler<1,1> &mg_dof, - const unsigned int steps); - - /** - * Constructor. This one collects - * the indices of the degrees of - * freedom on the interior - * boundaries between the - * different levels, which are - * needed by the function - * @p set_zero_interior_boundaries. - * - * The parameter steps indicates - * the number of smoothing steps - * to be executed by @p smooth. - */ - template - MGSmootherContinuous (const MGDoFHandler &mg_dof, - const unsigned int steps); - - /** - * Reset the values of the degrees of - * freedom on interior boundaries between - * different levels to zero in the given - * data vector @p u. - * - * Since the coarsest level (level==0) - * has no interior boundaries, this - * function does nothing in this case. - */ - void set_zero_interior_boundary (const unsigned int level, - VECTOR& u) const; - - /** - * Modify the number of smoothing steps. - */ - void set_steps (const unsigned int steps); - - /** - * How many steps should be used? - */ - unsigned int get_steps() const; - - private: - /** - * Number of smoothing steps. - */ - unsigned int steps; - - /** - * For each level, we store a list of - * degree of freedom indices which are - * located on interior boundaries between - * differing levels of the triangulation. - * Since the coarsest level has no - * interior boundary dofs, the first - * entry refers to the second level. - * - * These arrays are set by the constructor. - * The entries for each level are sorted ascendingly. - */ - std::vector > interior_boundary_dofs; -}; - - /** * Smoother using relaxation classes. * @@ -568,24 +459,6 @@ MGSmootherIdentity::smooth ( const VECTOR&) const {} -/*----------------------------------------------------------------------*/ - -template -inline -void -MGSmootherContinuous::set_steps (const unsigned int i) -{ - steps = i; -} - -template -inline -unsigned int -MGSmootherContinuous::get_steps() const -{ - return steps; -} - //--------------------------------------------------------------------------- template diff --git a/deal.II/deal.II/include/multigrid/mg_tools.h b/deal.II/deal.II/include/multigrid/mg_tools.h index e750f81233..046decf5da 100644 --- a/deal.II/deal.II/include/multigrid/mg_tools.h +++ b/deal.II/deal.II/include/multigrid/mg_tools.h @@ -126,7 +126,6 @@ class MGTools make_flux_sparsity_pattern_edge (const MGDoFHandler &dof_handler, SparsityPattern &sparsity, const unsigned int level); - /** * This function does the same as * the other with the same name, @@ -243,12 +242,15 @@ class MGTools const typename FunctionMap::type& function_map, std::vector >& boundary_indices, const std::vector& component_mask = std::vector()); + /** + */ template static void apply_boundary_values ( const std::set &boundary_dofs, SparseMatrix& matrix, - const bool preserve_symmetry); + const bool preserve_symmetry, + const bool ignore_zeros = false); template static void apply_boundary_values ( diff --git a/deal.II/deal.II/include/multigrid/mg_transfer.h b/deal.II/deal.II/include/multigrid/mg_transfer.h index 871d364603..600af6db41 100644 --- a/deal.II/deal.II/include/multigrid/mg_transfer.h +++ b/deal.II/deal.II/include/multigrid/mg_transfer.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -16,6 +16,7 @@ #include #include +#include #ifdef DEAL_PREFER_MATRIX_EZ # include # include @@ -63,11 +64,23 @@ template class MGTransferPrebuilt : public MGTransferBase { public: + /** + * Constructor without constraint + * matrices. Use this constructor + * only with discontinuous finite + * elements or with no local + * refinement. + */ + MGTransferPrebuilt (); + + /** + * Constructor with constraint matrices. + */ + MGTransferPrebuilt (const ConstraintMatrix& constraints); /** * Destructor. */ virtual ~MGTransferPrebuilt (); - /** * Actually build the prolongation * matrices for each level. @@ -176,6 +189,42 @@ class MGTransferPrebuilt : public MGTransferBase */ std::vector > copy_indices; + + /** + * Fill the two boolean vectors + * #dofs_on_refinement_edge and + * #dofs_on_refinement_boundary. + */ + template + void find_dofs_on_refinement_edges ( + const MGDoFHandler& mg_dof); + + /** + * Degrees of freedom on the + * refinement edge excluding + * those on the boundary. + * + * @todo Clean up names + */ + std::vector > dofs_on_refinement_edge; + /** + * The degrees of freedom on the + * the refinement edges. For each + * level (outer vector) and each + * dof index (inner vector), this + * bool is true if the level + * degree of freedom is on the + * refinement edge towards the + * lower level. + * + * @todo Clean up names + */ + std::vector > dofs_on_refinement_boundary; + /** + * The constraints of the global + * system. + */ + SmartPointer constraints; }; diff --git a/deal.II/deal.II/include/multigrid/mg_transfer.templates.h b/deal.II/deal.II/include/multigrid/mg_transfer.templates.h index 3fa2e06042..804421ac47 100644 --- a/deal.II/deal.II/include/multigrid/mg_transfer.templates.h +++ b/deal.II/deal.II/include/multigrid/mg_transfer.templates.h @@ -15,7 +15,6 @@ #define __deal2__mg_transfer_templates_h #include -#include #include #include #include @@ -79,10 +78,15 @@ MGTransferPrebuilt::copy_from_mg( // to the coarse level, but // have fine level basis // functions + dst = 0; for (unsigned int level=0;levelfirst) = src[level](i->second); + } + if (constraints != 0) + constraints->condense(dst); } @@ -91,7 +95,7 @@ template template void MGTransferPrebuilt::copy_from_mg_add ( - const MGDoFHandler &mg_dof_handler, + const MGDoFHandler& mg_dof_handler, OutVector &dst, const MGLevelObject &src) const { @@ -108,6 +112,67 @@ MGTransferPrebuilt::copy_from_mg_add ( dst(i->first) += src[level](i->second); } +template +template +void MGTransferPrebuilt::find_dofs_on_refinement_edges ( + const MGDoFHandler& mg_dof) +{ + for (unsigned int level = 0; level tmp (mg_dof.n_dofs(level)); + dofs_on_refinement_edge.push_back (tmp); + dofs_on_refinement_boundary.push_back (tmp); + } + + const unsigned int dofs_per_cell = mg_dof.get_fe().dofs_per_cell; + const unsigned int dofs_per_face = mg_dof.get_fe().dofs_per_face; + + std::vector local_dof_indices (dofs_per_cell); + std::vector face_dof_indices (dofs_per_face); + + typename MGDoFHandler::cell_iterator cell = mg_dof.begin(), + endc = mg_dof.end(); + + for (; cell!=endc; ++cell) + { + std::vector cell_dofs(dofs_per_cell); + std::vector boundary_cell_dofs(dofs_per_cell); + const unsigned int level = cell->level(); + cell->get_mg_dof_indices (local_dof_indices); + for (unsigned int face_nr=0; + face_nr::faces_per_cell; ++face_nr) + { + typename DoFHandler::face_iterator face = cell->face(face_nr); + if(!cell->at_boundary(face_nr)) + { + //interior face + typename MGDoFHandler::cell_iterator neighbor + = cell->neighbor(face_nr); + // Do refinement face + // from the coarse side + if (neighbor->level() < cell->level()) + { + for(unsigned int j=0; j unsigned int diff --git a/deal.II/deal.II/include/multigrid/multigrid.h b/deal.II/deal.II/include/multigrid/multigrid.h index 26ec75f385..15050e2412 100644 --- a/deal.II/deal.II/include/multigrid/multigrid.h +++ b/deal.II/deal.II/include/multigrid/multigrid.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by the deal.II authors +// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -103,6 +103,7 @@ class Multigrid : public Subscriptor const MGSmootherBase& pre_smooth, const MGSmootherBase& post_smooth, Cycle cycle = v_cycle); + /** * Experimental constructor for * cases in which no MGDoFHandler @@ -214,6 +215,37 @@ class Multigrid : public Subscriptor */ void Tvmult_add(VECTOR& dst, const VECTOR& src) const; + /** + * Set additional matrices to + * correct residual computation + * at refinement edges. Since we + * only smoothen in the interior + * of the refined part of the + * mesh, the coupling across the + * refinement edge is + * missing. This coupling is + * provided by these two + * matrices. + * + * @note While + * edge_out.vmult is + * used, for the second argument, + * we use + * edge_in.Tvmult. Thus, + * edge_in should be + * assembled in transposed + * form. This saves a second + * sparsity pattern for + * edge_in. In + * particular, for symmetric + * operators, both arguments can + * refer to the same matrix, + * saving assembling of one of + * them. + */ + void set_edge_matrices (const MGMatrixBase& edge_out, + const MGMatrixBase& edge_in); + /** * Set additional matrices to * correct residual computation @@ -224,9 +256,25 @@ class Multigrid : public Subscriptor * correspond tu the edge fluxes * at the refinement edge between * two levels. - */ - void set_edge_matrices (const MGMatrixBase& edge_down, - const MGMatrixBase& edge_up); + * + * @note While + * edge_down.vmult is + * used, for the second argument, + * we use + * edge_up.Tvmult. Thus, + * edge_up should be + * assembled in transposed + * form. This saves a second + * sparsity pattern for + * edge_up. In + * particular, for symmetric + * operators, both arguments can + * refer to the same matrix, + * saving assembling of one of + * them. + */ + void set_edge_flux_matrices (const MGMatrixBase& edge_down, + const MGMatrixBase& edge_up); /** * Return the finest level for @@ -396,13 +444,39 @@ class Multigrid : public Subscriptor */ SmartPointer,Multigrid > post_smooth; + /** + * Edge matrix from the interior + * of the refined part to the + * refinement edge. + * + * @note Only vmult is + * used for these matrices. + */ + SmartPointer > edge_out; + + /** + * Transpose edge matrix from the + * refinement edge to the + * interior of the refined part. + * + * @note Only Tvmult is + * used for these matrices. + */ + SmartPointer > edge_in; + /** * Edge matrix from fine to coarse. + * + * @note Only vmult is + * used for these matrices. */ SmartPointer,Multigrid > edge_down; /** * Transpose edge matrix from coarse to fine. + * + * @note Only Tvmult is + * used for these matrices. */ SmartPointer,Multigrid > edge_up; diff --git a/deal.II/deal.II/include/multigrid/multigrid.templates.h b/deal.II/deal.II/include/multigrid/multigrid.templates.h index e53e8ccc0e..e0710af388 100644 --- a/deal.II/deal.II/include/multigrid/multigrid.templates.h +++ b/deal.II/deal.II/include/multigrid/multigrid.templates.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors +// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -42,6 +42,8 @@ Multigrid::Multigrid (const unsigned int minlevel, transfer(&transfer, typeid(*this).name()), pre_smooth(&pre_smooth, typeid(*this).name()), post_smooth(&post_smooth, typeid(*this).name()), + edge_out(0, typeid(*this).name()), + edge_in(0, typeid(*this).name()), edge_down(0, typeid(*this).name()), edge_up(0, typeid(*this).name()), debug(0) @@ -103,11 +105,19 @@ void Multigrid::set_edge_matrices (const MGMatrixBase& down, const MGMatrixBase& up) { - edge_down = &down; - edge_up = &up; + edge_out = &down; + edge_in = &up; } +template +void +Multigrid::set_edge_flux_matrices (const MGMatrixBase& down, + const MGMatrixBase& up) +{ + edge_down = &down; + edge_up = &up; +} template @@ -150,10 +160,12 @@ Multigrid::level_v_step(const unsigned int level) for (unsigned int l = level;l>minlevel;--l) { t[l-1] = 0.; + if (l==level && edge_out != 0) + edge_out->vmult_add(level, t[level], solution[level]); + if (l==level && edge_down != 0) - { - edge_down->vmult(level, t[level-1], solution[level]); - } + edge_down->vmult(level, t[level-1], solution[level]); + transfer->restrict_and_add (l, t[l-1], t[l]); defect[l-1] -= t[l-1]; } @@ -173,12 +185,18 @@ Multigrid::level_v_step(const unsigned int level) solution[level] += t[level]; - if (edge_up != 0) + if (edge_in != 0) { - edge_up->Tvmult(level, t[level], solution[level-1]); + edge_in->Tvmult(level, t[level], solution[level]); defect[level] -= t[level]; } + if (edge_up != 0) + { + edge_up->Tvmult(level, t[level], solution[level-1]); + defect[level] -= t[level]; + } + if (debug>2) deallog << "V-cycle Defect norm " << defect[level].l2_norm() << std::endl; @@ -261,8 +279,12 @@ Multigrid::level_step(const unsigned int level, // coarse-level defect already // contain the global defect, the // refined parts its restriction. + if (edge_out != 0) + edge_out->vmult_add(level, t[level], solution[level]); + if (edge_down != 0) edge_down->vmult_add(level, defect2[level-1], solution[level]); + transfer->restrict_and_add (level, defect2[level-1], t[level]); // do recursion solution[level-1] = 0.; @@ -296,11 +318,12 @@ Multigrid::level_step(const unsigned int level, solution[level] += t[level]; - if (edge_up != 0) - { - edge_up->Tvmult(level, t[level], solution[level-1]); - } + if (edge_in != 0) + edge_in->Tvmult(level, t[level], solution[level]); + if (edge_up != 0) + edge_up->Tvmult(level, t[level], solution[level-1]); + t[level].sadd(-1.,-1.,defect2[level],1.,defect[level]); if (debug>2) diff --git a/deal.II/deal.II/source/multigrid/mg_dof_tools.cc b/deal.II/deal.II/source/multigrid/mg_dof_tools.cc index 763e06e2be..22c40f93ed 100644 --- a/deal.II/deal.II/source/multigrid/mg_dof_tools.cc +++ b/deal.II/deal.II/source/multigrid/mg_dof_tools.cc @@ -907,7 +907,6 @@ MGTools::make_flux_sparsity_pattern_edge ( } - template void MGTools::count_dofs_per_component ( diff --git a/deal.II/deal.II/source/multigrid/mg_smoother.cc b/deal.II/deal.II/source/multigrid/mg_smoother.cc deleted file mode 100644 index 76a5a9af7e..0000000000 --- a/deal.II/deal.II/source/multigrid/mg_smoother.cc +++ /dev/null @@ -1,139 +0,0 @@ -//--------------------------------------------------------------------------- -// $Id$ -// Version: $Name$ -// -// Copyright (C) 1999, 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 -// to the file deal.II/doc/license.html for the text and -// further information on this license. -// -//--------------------------------------------------------------------------- - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -DEAL_II_NAMESPACE_OPEN - - -////////////////////////////////////////////////////////////////////// - - - -#if deal_II_dimension == 1 - -template -MGSmootherContinuous::MGSmootherContinuous ( - const MGDoFHandler<1> &/*mg_dof*/, - const unsigned int steps) - : - steps(steps) -{ - Assert (false, ExcNotImplemented()); -} - -#endif - - -#if deal_II_dimension > 1 - -template -template -MGSmootherContinuous::MGSmootherContinuous ( - const MGDoFHandler &mg_dof, - const unsigned int steps) - : - steps(steps) -{ - const unsigned int n_levels = mg_dof.get_tria().n_levels(); - - // allocate the right number of - // elements - interior_boundary_dofs.resize (n_levels-1); - - // use a temporary to store the - // indices. this allows to not allocate - // to much memory by later copying the - // content of this vector to its final - // destination - std::vector boundary_dofs; - - // temporary to hold the dof indices - // on a face between to levels - std::vector dofs_on_face (mg_dof.get_fe().dofs_per_face); - - for (unsigned int level=1; level::cell_iterator cell=mg_dof.begin(level); - cell != mg_dof.end(level); ++cell) - for (unsigned int face=0; face::faces_per_cell; ++face) - if ((cell->neighbor(face).state() == IteratorState::valid) && - (static_cast(cell->neighbor(face)->level()) - == level-1)) - { - // get indices of this face - cell->face(face)->get_mg_dof_indices (level, dofs_on_face); - // append them to the levelwise - // list - boundary_dofs.insert (boundary_dofs.end(), - dofs_on_face.begin(), - dofs_on_face.end()); - }; - - // now sort the list of interior boundary - // dofs and eliminate duplicates - std::sort (boundary_dofs.begin(), boundary_dofs.end()); - boundary_dofs.erase (std::unique (boundary_dofs.begin(), - boundary_dofs.end()), - boundary_dofs.end()); - - // now finally copy the result - // for this level its destination - interior_boundary_dofs[level-1] = boundary_dofs; - }; -} - -#endif - - -// explicit instantiations - -// don't do the following instantiation in 1d, since there is a specialized -// function there -#if deal_II_dimension > 1 -template MGSmootherContinuous >::MGSmootherContinuous ( - const MGDoFHandler&, - const unsigned int); -template MGSmootherContinuous >::MGSmootherContinuous ( - const MGDoFHandler&, - const unsigned int); -template MGSmootherContinuous >::MGSmootherContinuous ( - const MGDoFHandler&, - const unsigned int); -template MGSmootherContinuous >::MGSmootherContinuous ( - const MGDoFHandler&, - const unsigned int); -#endif - -DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/deal.II/source/multigrid/mg_tools.all_dimensions.cc b/deal.II/deal.II/source/multigrid/mg_tools.all_dimensions.cc index 0ff5d6ca11..e85e42f8fd 100644 --- a/deal.II/deal.II/source/multigrid/mg_tools.all_dimensions.cc +++ b/deal.II/deal.II/source/multigrid/mg_tools.all_dimensions.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors +// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -32,7 +32,8 @@ void MGTools::apply_boundary_values ( const std::set &boundary_dofs, SparseMatrix& matrix, - const bool preserve_symmetry) + const bool preserve_symmetry, + const bool ignore_zeros) { // if no boundary values are to be applied // simply return @@ -95,10 +96,9 @@ MGTools::apply_boundary_values ( // // store the new rhs entry to make // the gauss step more efficient - matrix.set (dof_number, dof_number, - first_nonzero_diagonal_entry); - - + if(!ignore_zeros) + matrix.set (dof_number, dof_number, + first_nonzero_diagonal_entry); // if the user wants to have // the symmetry of the matrix // preserved, and if the @@ -431,10 +431,10 @@ MGTools::apply_boundary_values ( template void MGTools::apply_boundary_values ( const std::set&, - SparseMatrix&, const bool); + SparseMatrix&, const bool, const bool); template void MGTools::apply_boundary_values ( const std::set&, - SparseMatrix&, const bool); + SparseMatrix&, const bool, const bool); template void MGTools::apply_boundary_values ( const std::set&, BlockSparseMatrix&, const bool); diff --git a/deal.II/deal.II/source/multigrid/mg_transfer_prebuilt.cc b/deal.II/deal.II/source/multigrid/mg_transfer_prebuilt.cc index a2e7137008..04921170bd 100644 --- a/deal.II/deal.II/source/multigrid/mg_transfer_prebuilt.cc +++ b/deal.II/deal.II/source/multigrid/mg_transfer_prebuilt.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors +// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -12,6 +12,7 @@ //--------------------------------------------------------------------------- #include +#include #include #include @@ -23,6 +24,7 @@ #include #include #include +#include #include #include @@ -35,6 +37,7 @@ template void MGTransferPrebuilt::build_matrices ( const MGDoFHandler &mg_dof) { + //start building the matrices here const unsigned int n_levels = mg_dof.get_tria().n_levels(); const unsigned int dofs_per_cell = mg_dof.get_fe().dofs_per_cell; @@ -156,9 +159,42 @@ void MGTransferPrebuilt::build_matrices ( } } } - // For non-DG elements, add a - // condense operator here. + // impose boundary conditions + // but only in the column of + // the prolongation matrix + //TODO: this way is not very efficient + std::vector > boundary_indices (mg_dof.get_tria().n_levels()); + typename FunctionMap::type boundary; + ZeroFunction homogeneous_dirichlet_bc (1); + boundary[0] = &homogeneous_dirichlet_bc; + MGTools::make_boundary_list(mg_dof, boundary, boundary_indices); + + for (unsigned int level=0; levelm(); + for (unsigned int i=0; i::iterator anfang = prolongation_matrices[level]->begin(i), + ende = prolongation_matrices[level]->end(i); + for(; anfang != ende; ++anfang) + { + std::set::const_iterator dof = boundary_indices[level].begin(), + endd = boundary_indices[level].end(); + for (; dof != endd; ++dof) + { + const unsigned int column_number = anfang->column(); + const unsigned int dof_number = *dof; + if(dof_number == column_number) + prolongation_matrices[level]->set(i,dof_number,0); + } + } + } + } + find_dofs_on_refinement_edges (mg_dof); // Prepare indices to copy from a // global vector to the parts of an // MGVector corresponding to active @@ -188,6 +224,7 @@ void MGTransferPrebuilt::build_matrices ( for (unsigned int i=0; i::print_vector (const unsigned int level, #endif +template +MGTransferPrebuilt::MGTransferPrebuilt () +{} + + +template +MGTransferPrebuilt::MGTransferPrebuilt (const ConstraintMatrix &c) + : + constraints(&c) +{} template @@ -133,10 +143,6 @@ void MGTransferPrebuilt::restrict_and_add ( prolongation_matrices[from_level-1]->Tvmult_add (dst, src); } - - - - template MGTransferBlock::MGTransferBlock () : @@ -312,21 +318,6 @@ void MGTransferSelect::restrict_and_add ( } -template -void -MGSmootherContinuous::set_zero_interior_boundary ( - const unsigned int level, - VECTOR& u) const -{ - if (level==0) - return; - else - for (std::vector::const_iterator p=interior_boundary_dofs[level-1].begin(); - p!=interior_boundary_dofs[level-1].end(); ++p) - u(*p) = 0; -} - - //----------------------------------------------------------------------// template @@ -383,17 +374,5 @@ template class MGTransferSelect; template class MGTransferBlockSelect; template class MGTransferBlockSelect; -template -void MGSmootherContinuous >::set_zero_interior_boundary ( - const unsigned int, Vector&) const; -template -void MGSmootherContinuous >::set_zero_interior_boundary ( - const unsigned int, Vector&) const; -template -void MGSmootherContinuous >::set_zero_interior_boundary ( - const unsigned int, BlockVector&) const; -template -void MGSmootherContinuous >::set_zero_interior_boundary ( - const unsigned int, BlockVector&) const; DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/examples/step-39/step-39.cc b/deal.II/examples/step-39/step-39.cc index 2961469b46..ca908a2997 100644 --- a/deal.II/examples/step-39/step-39.cc +++ b/deal.II/examples/step-39/step-39.cc @@ -3,7 +3,7 @@ /* $Id$ */ /* */ -/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by the deal.II authors */ +/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by the deal.II authors */ /* */ /* This file is subject to QPL and may not be distributed */ /* without copyright and license information. Please refer */ @@ -533,7 +533,7 @@ Step39::solve() Multigrid > mg(mg_dof_handler, mgmatrix, mg_coarse, mg_transfer, mg_smoother, mg_smoother); - mg.set_edge_matrices(mgdown, mgup); + mg.set_edge_flux_matrices(mgdown, mgup); mg.set_debug(0); mg_smoother.set_debug(0);