From bbb9d42ef8a0a3f74f67cf34685d8c5b8d6b3163 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 30 May 2017 11:42:09 +0200 Subject: [PATCH] add mg::Matrix::reset() and MGCoarseGridApplySmoother::clear() --- include/deal.II/multigrid/mg_coarse.h | 14 ++++++++++++++ include/deal.II/multigrid/mg_matrix.h | 15 +++++++++++++++ 2 files changed, 29 insertions(+) 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 -- 2.39.5