From: guido Date: Thu, 4 Dec 2003 12:15:19 +0000 (+0000) Subject: beatificatio X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7206cd84936b6619b3896759e78a9aab135a6167;p=dealii-svn.git beatificatio git-svn-id: https://svn.dealii.org/trunk@8230 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/doc/doxygen/headers/lac/dox.h b/deal.II/doc/doxygen/headers/lac/dox.h index 5a03c4cf72..6dfacd8d1b 100644 --- a/deal.II/doc/doxygen/headers/lac/dox.h +++ b/deal.II/doc/doxygen/headers/lac/dox.h @@ -12,40 +12,86 @@ //------------------------------------------------------------------------- /** - * @defgroup Solvers Linear Solver classes - * - * Here we collect iterative solvers and some control classes. All - * solvers inherit from the class template Solver, which provides some - * basic maintenance methods. + * @defgroup Vectors Vector classes * - * The number of iteration steps of all solvers is controlled by - * objects of class SolverControl or its derived class - * ReductionControl. + * Here, we list all the classes that can be used as VECTOR in linear solvers + * (see Solver) and for matrix operations. */ /** * @defgroup Matrices Matrix classes * @{ * - * All matrices in this library have a common minimal interface, - * defined through MATRIX. This interface consists of functions for - * multiplication with appropriate vectors. + * All matrices in this library have a common minimal interface, defined + * through MATRIX (see Solver documentation). This interface consists of + * functions for multiplication with appropriate vectors. + * + * We split this module into several parts. Basic matrices are all the matrix + * classes actually storing their entries. Derived matrices use basic + * matrices, but change the meaning of the matrix-vector multiplication. * + * Preconditioners are matrix classes as well, since they perform linear + * operations on vectors. + * + * @author Guido Kanschat, 2003 */ /** * @defgroup Matrix1 Basic matrices * - * These are the actual matrix classes provided by deal.II. They all - * provide some interface for allocating memory and entering values. -*/ + * These are the actual matrix classes provided by deal.II. It is possible to + * store values in them and retrieve them. Furthermore, they provide the full + * interface required by linear solvers (see Solver). + * + * @author Guido Kanschat, 2003 + */ /** * @defgroup Matrix2 Derived matrices + * + * These matrices are built on top of the basic matrices. They perform special + * operations using the interface defined in Solver. + * + * @author Guido Kanschat, 2003 */ /** * @defgroup Preconditioners Preconditioners - * @} + * In principle, preconditioners are matrices themselves. But, since they are + * only used in a special context, we put them in a separate group. + * + * @author Guido Kanschat, 2003 + */ + + /*@}*/ + +/** + * @defgroup Solvers Linear Solver classes + * + * Here we collect iterative solvers and some control classes. All + * solvers inherit from the class template Solver, which provides some + * basic maintenance methods. + * + * The number of iteration steps of all solvers is controlled by + * objects of class SolverControl or its derived class + * ReductionControl. + * + * All solvers receive the matrix and vector classes as template + * arguments. Therefore, any objects defining the interface described in the + * documentation of Solver are admissible. + * + * @author Guido Kanschat, 2003 + */ + +/** + * @defgroup VMemory Vector memory management + * + * A few classes that are used to avoid allocating and deallocating vectors in + * iterative procedures. These methods all use an object of the base class + * VectorMemory to get their auxiliary vectors. Unfortunately, the + * intelligence put into both implementations provided right now is not + * overwhelming. + * + * @author Guido Kanschat, 2003 */ diff --git a/deal.II/lac/include/lac/block_vector.h b/deal.II/lac/include/lac/block_vector.h index 1b7a4f0795..26c063f82e 100644 --- a/deal.II/lac/include/lac/block_vector.h +++ b/deal.II/lac/include/lac/block_vector.h @@ -27,6 +27,9 @@ template class BlockVector; +/*! @addtogroup Vectors + *@{ + */ namespace internal { @@ -1238,6 +1241,8 @@ class BlockVector template friend class BlockVector; }; +/*@}*/ + /*----------------------- Inline functions ----------------------------------*/ @@ -1842,6 +1847,10 @@ namespace internal } //namespace internal +/*! @addtogroup Vectors + *@{ + */ + /** * Global function @p{swap} which overloads the default implementation * of the C++ standard library which uses a temporary object. The @@ -1858,6 +1867,6 @@ void swap (BlockVector &u, } - +/*@}*/ #endif diff --git a/deal.II/lac/include/lac/swappable_vector.h b/deal.II/lac/include/lac/swappable_vector.h index 01f00febeb..981e475f89 100644 --- a/deal.II/lac/include/lac/swappable_vector.h +++ b/deal.II/lac/include/lac/swappable_vector.h @@ -19,6 +19,9 @@ #include #include +/*! @addtogroup Vectors + *@{ + */ /** * This class is a wrapper to the @p{Vector} class which allows to swap @@ -305,6 +308,7 @@ class SwappableVector : public Vector void reload_vector (const bool set_flag); }; +/*@}*/ /*---------------------------- swappable_vector.h ---------------------------*/ /* end of #ifndef __deal2__swappable_vector_h */ #endif diff --git a/deal.II/lac/include/lac/vector.h b/deal.II/lac/include/lac/vector.h index 46fd41aea4..50daac753e 100644 --- a/deal.II/lac/include/lac/vector.h +++ b/deal.II/lac/include/lac/vector.h @@ -19,6 +19,10 @@ #include +/*! @addtogroup Vectors + *@{ + */ + /** * Numerical vector of data. For this class there are different types @@ -580,6 +584,7 @@ class Vector template friend class Vector; }; +/*@}*/ /*----------------------- Inline functions ----------------------------------*/ @@ -773,6 +778,9 @@ Vector & Vector::operator = (const Number s) return *this; } +/*! @addtogroup Vectors + *@{ + */ /** @@ -789,6 +797,6 @@ void swap (Vector &u, Vector &v) u.swap (v); } - +/*@}*/ #endif diff --git a/deal.II/lac/include/lac/vector_memory.h b/deal.II/lac/include/lac/vector_memory.h index 28461bd301..7691c1d8e7 100644 --- a/deal.II/lac/include/lac/vector_memory.h +++ b/deal.II/lac/include/lac/vector_memory.h @@ -22,7 +22,10 @@ #include +/*!@addtogroup VMemory */ +/*@{*/ +//! Base class for vector memory management /** * Memory management base class for vectors. This is an abstract base * class used by all iterative methods to allocate space for @@ -37,7 +40,7 @@ * * @author Guido Kanschat, 1998-2003 */ -template > +template > class VectorMemory : public Subscriptor { public: @@ -52,13 +55,13 @@ class VectorMemory : public Subscriptor /** * Return new vector from the pool. */ - virtual Vector* alloc() = 0; + virtual VECTOR* alloc() = 0; /** * Return a vector into the pool * for later use. */ - virtual void free (const Vector * const) = 0; + virtual void free (const VECTOR * const) = 0; /** * No more available vectors. */ @@ -70,15 +73,15 @@ class VectorMemory : public Subscriptor DeclException0(ExcNotAllocatedHere); }; - +//! Sample implementation using system memory management. /** * Simple memory management. This memory class is just made for * tests. It just allocates and deletes * vectors as needed from the global heap, i.e. performs no * specially adapted actions to the purpose of this class. */ -template > -class PrimitiveVectorMemory : public VectorMemory +template > +class PrimitiveVectorMemory : public VectorMemory { public: /** @@ -90,21 +93,21 @@ class PrimitiveVectorMemory : public VectorMemory * Allocate a vector * from the global heap. */ - virtual Vector* alloc() + virtual VECTOR* alloc() { - return new Vector(); + return new VECTOR(); } /** * Return a vector to the global heap. */ - virtual void free (const Vector * const v) + virtual void free (const VECTOR * const v) { delete v; } }; - +//! Keeps all vectors and avoids reallocation. /** * Memory keeping allocated vectors. This @p{VectorMemory} is able to * grow infinitely (according to computer memory). A vector once @@ -113,8 +116,8 @@ class PrimitiveVectorMemory : public VectorMemory * * @author Guido Kanschat, 1999 */ -template > -class GrowingVectorMemory : public VectorMemory +template > +class GrowingVectorMemory : public VectorMemory { public: /** @@ -141,13 +144,13 @@ class GrowingVectorMemory : public VectorMemory /** * Return new vector from the pool. */ - virtual Vector* alloc(); + virtual VECTOR* alloc(); /** * Return a vector into the pool * for later use. */ - virtual void free (const Vector * const); + virtual void free (const VECTOR * const); private: /** @@ -157,7 +160,7 @@ class GrowingVectorMemory : public VectorMemory * vector is used, second the * vector itself. */ - typedef std::pair entry_type; + typedef std::pair entry_type; /** * Array of allocated vectors. @@ -177,11 +180,13 @@ class GrowingVectorMemory : public VectorMemory Threads::ThreadMutex mutex; }; +/*@}*/ + /* --------------------- inline functions ---------------------- */ -template -GrowingVectorMemory::GrowingVectorMemory(const unsigned int initial_size) +template +GrowingVectorMemory::GrowingVectorMemory(const unsigned int initial_size) : pool(initial_size) { Threads::ThreadMutex::ScopedLock lock(mutex); @@ -190,7 +195,7 @@ GrowingVectorMemory::GrowingVectorMemory(const unsigned int initial_size ++i) { i->first = false; - i->second = new Vector; + i->second = new VECTOR; }; // no vectors yet claimed @@ -199,8 +204,8 @@ GrowingVectorMemory::GrowingVectorMemory(const unsigned int initial_size -template -GrowingVectorMemory::~GrowingVectorMemory() +template +GrowingVectorMemory::~GrowingVectorMemory() { Threads::ThreadMutex::ScopedLock lock(mutex); @@ -230,9 +235,9 @@ GrowingVectorMemory::~GrowingVectorMemory() -template -Vector * -GrowingVectorMemory::alloc() +template +VECTOR * +GrowingVectorMemory::alloc() { Threads::ThreadMutex::ScopedLock lock(mutex); ++n_alloc; @@ -247,7 +252,7 @@ GrowingVectorMemory::alloc() } } - const entry_type t (true, new Vector); + const entry_type t (true, new VECTOR); pool.push_back(t); return t.second; @@ -255,9 +260,9 @@ GrowingVectorMemory::alloc() -template +template void -GrowingVectorMemory::free(const Vector* const v) +GrowingVectorMemory::free(const VECTOR* const v) { Threads::ThreadMutex::ScopedLock lock(mutex); for (typename std::vector::iterator i=pool.begin();i != pool.end() ;++i) @@ -268,7 +273,7 @@ GrowingVectorMemory::free(const Vector* const v) return; } } - Assert(false, typename VectorMemory::ExcNotAllocatedHere()); + Assert(false, typename VectorMemory::ExcNotAllocatedHere()); }