From: Denis Davydov Date: Tue, 30 May 2017 09:42:09 +0000 (+0200) Subject: add mg::Matrix::reset() and MGCoarseGridApplySmoother::clear() X-Git-Tag: v9.0.0-rc1~1557^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbb9d42ef8a0a3f74f67cf34685d8c5b8d6b3163;p=dealii.git add mg::Matrix::reset() and MGCoarseGridApplySmoother::clear() --- diff --git a/include/deal.II/multigrid/mg_coarse.h b/include/deal.II/multigrid/mg_coarse.h index b14c4c74c1..0fc198aac0 100644 --- a/include/deal.II/multigrid/mg_coarse.h +++ b/include/deal.II/multigrid/mg_coarse.h @@ -47,6 +47,11 @@ public: */ MGCoarseGridApplySmoother (const MGSmootherBase &coarse_smooth); + /** + * Clear the pointer. + */ + void clear (); + /** * Initialize new data. */ @@ -329,6 +334,15 @@ MGCoarseGridApplySmoother::initialize (const MGSmootherBase +void +MGCoarseGridApplySmoother::clear() +{ + coarse_smooth = nullptr; +} + + template void MGCoarseGridApplySmoother::operator() (const unsigned int level, diff --git a/include/deal.II/multigrid/mg_matrix.h b/include/deal.II/multigrid/mg_matrix.h index ec6c7b7eac..a717e34e88 100644 --- a/include/deal.II/multigrid/mg_matrix.h +++ b/include/deal.II/multigrid/mg_matrix.h @@ -64,6 +64,11 @@ namespace mg void initialize(const MGLevelObject &M); + /** + * Reset the object. + */ + void reset(); + /** * Access matrix on a level. */ @@ -185,6 +190,16 @@ namespace mg + template + inline + void + Matrix::reset () + { + matrices.resize(0,0); + } + + + template template inline