From: Wolfgang Bangerth Date: Tue, 30 Dec 2014 02:57:46 +0000 (-0600) Subject: Now that we no longer take a VectorMemory object as argument, simplify the functionin... X-Git-Tag: v8.3.0-rc1~566^2~19 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4aa6216173d1fbfa982b75398582ec79ede23a33;p=dealii.git Now that we no longer take a VectorMemory object as argument, simplify the functioning of the MGSmoother class and its derivatives. --- diff --git a/include/deal.II/multigrid/mg_smoother.h b/include/deal.II/multigrid/mg_smoother.h index 24fdd64c6c..87b5da9ee1 100644 --- a/include/deal.II/multigrid/mg_smoother.h +++ b/include/deal.II/multigrid/mg_smoother.h @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 1999 - 2013 by the deal.II authors +// Copyright (C) 1999 - 2014 by the deal.II authors // // This file is part of the deal.II library. // @@ -81,13 +81,16 @@ public: */ void set_debug (const unsigned int level); -private: +protected: /** - * The memory object to be used if none is given to the constructor. + * A memory object to be used for temporary vectors. + * + * The object is marked as mutable since we will need to use it + * to allocate temporary vectors also in functions that are + * const. */ - GrowingVectorMemory my_memory; + mutable GrowingVectorMemory vector_memory; -protected: /** * Number of smoothing steps on the finest level. If no #variable smoothing * is chosen, this is the number of steps on all levels. @@ -116,11 +119,6 @@ protected: * Output debugging information to @p deallog if this is nonzero. */ unsigned int debug; - - /** - * Memory for auxiliary vectors. - */ - SmartPointer, MGSmoother > mem; }; @@ -544,8 +542,7 @@ MGSmoother::MGSmoother( variable(variable), symmetric(symmetric), transpose(transpose), - debug(0), - mem(&my_memory) + debug(0) {} @@ -685,7 +682,7 @@ namespace mg return sizeof(*this) -sizeof(MGLevelObject) + MGLevelObject::memory_consumption() - + this->mem->memory_consumption(); + + this->vector_memory.memory_consumption(); } } @@ -854,7 +851,7 @@ memory_consumption () const return sizeof(*this) + matrices.memory_consumption() + smoothers.memory_consumption() - + this->mem->memory_consumption(); + + this->vector_memory.memory_consumption(); } @@ -1002,8 +999,8 @@ MGSmootherPrecondition::smooth( if (this->variable) steps2 *= (1<<(maxlevel-level)); - typename VectorMemory::Pointer r(*this->mem); - typename VectorMemory::Pointer d(*this->mem); + typename VectorMemory::Pointer r(this->vector_memory); + typename VectorMemory::Pointer d(this->vector_memory); r->reinit(u,true); d->reinit(u,true); @@ -1069,7 +1066,7 @@ memory_consumption () const return sizeof(*this) + matrices.memory_consumption() + smoothers.memory_consumption() - + this->mem->memory_consumption(); + + this->vector_memory.memory_consumption(); }