#include <base/subscriptor.h>
#include <base/smartpointer.h>
#include <lac/vector.h>
+#include <lac/vector_memory.h>
DEAL_II_NAMESPACE_OPEN
*
* If <tt>M</tt> is zero, no
* matrix is stored.
+ *
+ * If <tt>mem</tt> is zero, a
+ * PrimitiveVectorMemory is
+ * generated.
*/
PointerMatrixAux (VectorMemory<VECTOR>* mem = 0,
const MATRIX* M=0);
*/
virtual const void* get() const;
+ /**
+ * The backup memory if none was provided.
+ */
+ PrimitiveVectorMemory<VECTOR> my_memory;
+
/**
* Object for getting the
* auxiliary vector.
const MATRIX* M)
: mem(mem, typeid(*this).name()),
m(M, typeid(*this).name())
-{}
+{
+ if (mem == 0)
+ mem = &my_memory;
+}
template<class MATRIX, class VECTOR>
const char* name)
: mem(mem, name),
m(0, name)
-{}
+{
+ if (mem == 0)
+ mem = &my_memory;
+}
template<class MATRIX, class VECTOR>
const char* name)
: mem(mem, name),
m(M, name)
-{}
+{
+ if (mem == 0)
+ mem = &my_memory;
+}
template<class MATRIX, class VECTOR>
PointerMatrixAux<MATRIX, VECTOR>::set_memory(VectorMemory<VECTOR>* M)
{
mem = M;
+ if (mem == 0)
+ mem = &my_memory;
}