From: Guido Kanschat Date: Tue, 18 Apr 2000 22:00:13 +0000 (+0000) Subject: split off dimension independent stuff X-Git-Tag: v8.0.0~20652 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b01cac1e9ec800a85f364ef10413e8d1ad731c6b;p=dealii.git split off dimension independent stuff git-svn-id: https://svn.dealii.org/trunk@2746 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/multigrid/multigrid.templates.h b/deal.II/deal.II/include/multigrid/multigrid.templates.h index f93caa8f46..820d2bdc7d 100644 --- a/deal.II/deal.II/include/multigrid/multigrid.templates.h +++ b/deal.II/deal.II/include/multigrid/multigrid.templates.h @@ -81,6 +81,12 @@ Multigrid::copy_to_mg (const Vector& src) const MGDoFHandler::active_cell_iterator level_end = mg_dof_handler->end_active(level); +//TODO: Treat hanging nodes properly +// The single-level vector is not an FE-function, because the values at +// hanging nodes are set to zero. This should be treated before the restriction. + + // Compute coarse level right hand side + // by restricting from fine level. for (; level_cell!=level_end; ++level_cell, ++global_cell) { // get the dof numbers of @@ -96,8 +102,8 @@ Multigrid::copy_to_mg (const Vector& src) for (unsigned int i=0; i::faces_per_cell; ++face_n) { const MGDoFHandler::face_iterator face = level_cell->face(face_n); diff --git a/deal.II/deal.II/source/multigrid/multigrid.all_dimensions.cc b/deal.II/deal.II/source/multigrid/multigrid.all_dimensions.cc new file mode 100644 index 0000000000..6a2e53df99 --- /dev/null +++ b/deal.II/deal.II/source/multigrid/multigrid.all_dimensions.cc @@ -0,0 +1,52 @@ +//---------------------------- multigrid.all_dimensions.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 1998, 1999, 2000 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. +// +//---------------------------- multigrid.all_dimensions.cc --------------------------- + + + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +MGTransferPrebuilt::~MGTransferPrebuilt () +{}; + + +void MGTransferPrebuilt::prolongate (const unsigned int to_level, + Vector &dst, + const Vector &src) const +{ + Assert ((to_level >= 1) && (to_level<=prolongation_matrices.size()), + ExcIndexRange (to_level, 1, prolongation_matrices.size()+1)); + + prolongation_matrices[to_level-1].vmult (dst, src); +}; + + +void MGTransferPrebuilt::restrict_and_add (const unsigned int from_level, + Vector &dst, + const Vector &src) const +{ + Assert ((from_level >= 1) && (from_level<=prolongation_matrices.size()), + ExcIndexRange (from_level, 1, prolongation_matrices.size()+1)); + + prolongation_matrices[from_level-1].Tvmult_add (dst, src); +}; + + diff --git a/deal.II/deal.II/source/multigrid/multigrid.cc b/deal.II/deal.II/source/multigrid/multigrid.cc index 3dfefa448f..4a7c0442af 100644 --- a/deal.II/deal.II/source/multigrid/multigrid.cc +++ b/deal.II/deal.II/source/multigrid/multigrid.cc @@ -59,10 +59,6 @@ Multigrid::level_vmult (const unsigned int level, /* ----------------------------- MGTransferPrebuilt ------------------------ */ -MGTransferPrebuilt::~MGTransferPrebuilt () -{}; - - template void MGTransferPrebuilt::build_matrices (const MGDoFHandler &mg_dof) { @@ -174,28 +170,6 @@ void MGTransferPrebuilt::build_matrices (const MGDoFHandler &mg_dof) }; -void MGTransferPrebuilt::prolongate (const unsigned int to_level, - Vector &dst, - const Vector &src) const -{ - Assert ((to_level >= 1) && (to_level<=prolongation_matrices.size()), - ExcIndexRange (to_level, 1, prolongation_matrices.size()+1)); - - prolongation_matrices[to_level-1].vmult (dst, src); -}; - - -void MGTransferPrebuilt::restrict_and_add (const unsigned int from_level, - Vector &dst, - const Vector &src) const -{ - Assert ((from_level >= 1) && (from_level<=prolongation_matrices.size()), - ExcIndexRange (from_level, 1, prolongation_matrices.size()+1)); - - prolongation_matrices[from_level-1].Tvmult_add (dst, src); -}; - - // explicit instatations template class Multigrid; template