From 4a32af622d90fd1e01ccb21c3f3c461dadb0e791 Mon Sep 17 00:00:00 2001 From: guido Date: Mon, 6 Jan 2003 09:06:01 +0000 Subject: [PATCH] empty function added git-svn-id: https://svn.dealii.org/trunk@6865 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/multigrid/multigrid.h | 13 +++++++- deal.II/lac/include/lac/precondition_block.h | 32 ++++++++++++++++++- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/deal.II/deal.II/include/multigrid/multigrid.h b/deal.II/deal.II/include/multigrid/multigrid.h index a838431984..50b49f8a0d 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) 1998, 1999, 2000, 2001, 2002 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -255,6 +255,11 @@ class PreconditionMG : public Subscriptor PreconditionMG(const MGDoFHandler& mg_dof, Multigrid& mg, const TRANSFER& transfer); + + /** + * Dummy function needed by other classes. + */ + bool empty () const; /** * Preconditioning operator. @@ -370,6 +375,12 @@ PreconditionMG transfer(&transfer) {} +template +bool +PreconditionMG::empty () const +{ + return false; +} template void diff --git a/deal.II/lac/include/lac/precondition_block.h b/deal.II/lac/include/lac/precondition_block.h index f5af2a83e2..5181683551 100644 --- a/deal.II/lac/include/lac/precondition_block.h +++ b/deal.II/lac/include/lac/precondition_block.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -122,6 +122,11 @@ class PreconditionBlock : public virtual Subscriptor */ void clear(); + /** + * Checks whether the object is empty. + */ + bool empty () const; + /** * Use only the inverse of the * first diagonal block to save @@ -321,6 +326,11 @@ class PreconditionBlockJacobi : public virtual Subscriptor, */ PreconditionBlock::clear; + /** + * Make function of base class public again. + */ + PreconditionBlock::empty; + /** * Make function of base class public again. */ @@ -418,6 +428,11 @@ class PreconditionBlockSOR : public virtual Subscriptor, */ PreconditionBlock::clear; + /** + * Make function of base class public again. + */ + PreconditionBlock::empty; + /** * Make function of base class public again. */ @@ -502,6 +517,11 @@ class PreconditionBlockSSOR : public virtual Subscriptor, */ PreconditionBlockSOR::clear; + /** + * Make function of base class public again. + */ + PreconditionBlock::empty; + /** * Make function of base class public again. */ @@ -534,5 +554,15 @@ class PreconditionBlockSSOR : public virtual Subscriptor, void Tvmult (Vector&, const Vector&) const; }; +//----------------------------------------------------------------------// + +template +bool +PreconditionBlock::empty () const +{ + if (A == 0) + return true; + return A->empty(); +} #endif -- 2.39.5