From 347bd6b600dea8b768db9b8bdc0071ee7f73775c Mon Sep 17 00:00:00 2001 From: guido Date: Wed, 14 Jun 2006 12:02:57 +0000 Subject: [PATCH] Add default constructor and set_memory to PointerMatrixAux git-svn-id: https://svn.dealii.org/trunk@13244 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/news/changes.html | 11 +++++++++-- deal.II/lac/include/lac/pointer_matrix.h | 20 +++++++++++++++++++- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/deal.II/doc/news/changes.html b/deal.II/doc/news/changes.html index 5bd9a46fc4..3f599af85d 100644 --- a/deal.II/doc/news/changes.html +++ b/deal.II/doc/news/changes.html @@ -520,8 +520,15 @@ inconvenience this causes.
    -
  1. Fixed: The FullMatrix::print would yield a link error +

  2. Improved: PointerMatrixAux now has a + default constructor and a function for setting the VectorMemory object. +
    + (GK 2006/06/14) +

    + +
  3. Fixed: FullMatrix::print would yield a link error when used with std::ofstream since an explicit instantiation was missing. The function has now been moved to the header file and made inline so that it is always visible, diff --git a/deal.II/lac/include/lac/pointer_matrix.h b/deal.II/lac/include/lac/pointer_matrix.h index c38ea22c5d..3a2b3d822f 100644 --- a/deal.II/lac/include/lac/pointer_matrix.h +++ b/deal.II/lac/include/lac/pointer_matrix.h @@ -264,7 +264,7 @@ class PointerMatrixAux : public PointerMatrixBase * If M is zero, no * matrix is stored. */ - PointerMatrixAux (VectorMemory* mem, + PointerMatrixAux (VectorMemory* mem = 0, const MATRIX* M=0); /** @@ -296,6 +296,12 @@ class PointerMatrixAux : public PointerMatrixBase * empty. */ bool empty () const; + + /** + * Assign a new VectorMemory + object for getting auxiliary vectors. + */ + void set_memory(VectorMemory* mem); /** * Assign a new matrix @@ -584,6 +590,14 @@ PointerMatrixAux::operator= (const MATRIX* M) } +template +inline void +PointerMatrixAux::set_memory(VectorMemory* M) +{ + mem = M; +} + + template inline bool PointerMatrixAux::empty () const @@ -598,6 +612,7 @@ inline void PointerMatrixAux::vmult (VECTOR& dst, const VECTOR& src) const { + Assert (mem != 0, ExcNotInitialized()); Assert (m != 0, ExcNotInitialized()); m->vmult (dst, src); } @@ -608,6 +623,7 @@ inline void PointerMatrixAux::Tvmult (VECTOR& dst, const VECTOR& src) const { + Assert (mem != 0, ExcNotInitialized()); Assert (m != 0, ExcNotInitialized()); m->Tvmult (dst, src); } @@ -618,6 +634,7 @@ inline void PointerMatrixAux::vmult_add (VECTOR& dst, const VECTOR& src) const { + Assert (mem != 0, ExcNotInitialized()); Assert (m != 0, ExcNotInitialized()); VECTOR* v = mem->alloc(); v->reinit(dst); @@ -632,6 +649,7 @@ inline void PointerMatrixAux::Tvmult_add (VECTOR& dst, const VECTOR& src) const { + Assert (mem != 0, ExcNotInitialized()); Assert (m != 0, ExcNotInitialized()); VECTOR* v = mem->alloc(); v->reinit(dst); -- 2.39.5