]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
beatificatio
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 4 Dec 2003 12:15:19 +0000 (12:15 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 4 Dec 2003 12:15:19 +0000 (12:15 +0000)
git-svn-id: https://svn.dealii.org/trunk@8230 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/doxygen/headers/lac/dox.h
deal.II/lac/include/lac/block_vector.h
deal.II/lac/include/lac/swappable_vector.h
deal.II/lac/include/lac/vector.h
deal.II/lac/include/lac/vector_memory.h

index 5a03c4cf72634da4e4f998aeaa7b7341d5a2ab36..6dfacd8d1b16cfb50da16ac23afbe90a21044cbd 100644 (file)
 //-------------------------------------------------------------------------
 
 /**
- * @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
  */
index 1b7a4f07956986deb6b8b3164b23629aa592cdd9..26c063f82e20917d74342695a080f37c3c520c68 100644 (file)
@@ -27,6 +27,9 @@
 template <typename Number>
 class BlockVector;
 
+/*! @addtogroup Vectors
+ *@{
+ */
 
 namespace internal
 {
@@ -1238,6 +1241,8 @@ class BlockVector
     template <typename Number2> 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<Number> &u,
 }
 
 
-
+/*@}*/
 
 #endif
index 01f00febebaf9fe87bafa4286de66f9abae1d059..981e475f89e57ae788ecd40d67a83dd028944ced 100644 (file)
@@ -19,6 +19,9 @@
 #include <lac/vector.h>
 #include <string>
 
+/*! @addtogroup Vectors
+ *@{
+ */
 
 /**
  * This class is a wrapper to the @p{Vector} class which allows to swap
@@ -305,6 +308,7 @@ class SwappableVector : public Vector<number>
     void reload_vector (const bool set_flag);
 };
 
+/*@}*/
 /*----------------------------   swappable_vector.h     ---------------------------*/
 /* end of #ifndef __deal2__swappable_vector_h */
 #endif
index 46fd41aea4a963b769f80d85718a38fff4bae569..50daac753eed98534b07a55ea36806c40a42d8f1 100644 (file)
 
 #include <cstdio>
 
+/*! @addtogroup Vectors
+ *@{
+ */
+
 
 /**
  * Numerical vector of data.  For this class there are different types
@@ -580,6 +584,7 @@ class Vector
     template <typename Number2> friend class Vector;    
 };
 
+/*@}*/
 /*----------------------- Inline functions ----------------------------------*/
 
 
@@ -773,6 +778,9 @@ Vector<Number> & Vector<Number>::operator = (const Number s)
   return *this;
 }
 
+/*! @addtogroup Vectors
+ *@{
+ */
 
 
 /**
@@ -789,6 +797,6 @@ void swap (Vector<Number> &u, Vector<Number> &v)
   u.swap (v);
 }
 
-
+/*@}*/
 
 #endif
index 28461bd301032e3e1ecd99177551affbeb8630d5..7691c1d8e7b92d81696deb3305937db73beb407f 100644 (file)
 
 #include <vector>
 
+/*!@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<class Vector = ::Vector<double> >
+template<class VECTOR = ::Vector<double> >
 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 Vector = ::Vector<double> >
-class PrimitiveVectorMemory : public VectorMemory<Vector>
+template<class VECTOR = ::Vector<double> >
+class PrimitiveVectorMemory : public VectorMemory<VECTOR>
 {
   public:
                                     /**
@@ -90,21 +93,21 @@ class PrimitiveVectorMemory : public VectorMemory<Vector>
                                      * 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<Vector>
  * 
  * @author Guido Kanschat, 1999
  */
-template<class Vector = ::Vector<double> >
-class GrowingVectorMemory : public VectorMemory<Vector>
+template<class VECTOR = ::Vector<double> >
+class GrowingVectorMemory : public VectorMemory<VECTOR>
 {
   public:
                                     /**
@@ -141,13 +144,13 @@ class GrowingVectorMemory : public VectorMemory<Vector>
                                     /**
                                      * 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>
                                      * vector is used, second the
                                      * vector itself.
                                      */
-    typedef std::pair<bool, Vector*> entry_type;
+    typedef std::pair<bool, VECTOR*> entry_type;
 
                                     /**
                                      * Array of allocated vectors.
@@ -177,11 +180,13 @@ class GrowingVectorMemory : public VectorMemory<Vector>
     Threads::ThreadMutex mutex;
 };
 
+/*@}*/
+
 /* --------------------- inline functions ---------------------- */
 
 
-template <typename Vector>
-GrowingVectorMemory<Vector>::GrowingVectorMemory(const unsigned int initial_size)
+template <typename VECTOR>
+GrowingVectorMemory<VECTOR>::GrowingVectorMemory(const unsigned int initial_size)
                : pool(initial_size)
 {
   Threads::ThreadMutex::ScopedLock lock(mutex);
@@ -190,7 +195,7 @@ GrowingVectorMemory<Vector>::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<Vector>::GrowingVectorMemory(const unsigned int initial_size
 
 
 
-template<typename Vector>
-GrowingVectorMemory<Vector>::~GrowingVectorMemory()
+template<typename VECTOR>
+GrowingVectorMemory<VECTOR>::~GrowingVectorMemory()
 {
   Threads::ThreadMutex::ScopedLock lock(mutex);
 
@@ -230,9 +235,9 @@ GrowingVectorMemory<Vector>::~GrowingVectorMemory()
 
 
 
-template<typename Vector>
-Vector *
-GrowingVectorMemory<Vector>::alloc()
+template<typename VECTOR>
+VECTOR *
+GrowingVectorMemory<VECTOR>::alloc()
 {
   Threads::ThreadMutex::ScopedLock lock(mutex);
   ++n_alloc;
@@ -247,7 +252,7 @@ GrowingVectorMemory<Vector>::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<Vector>::alloc()
 
 
 
-template<typename Vector>
+template<typename VECTOR>
 void
-GrowingVectorMemory<Vector>::free(const Vector* const v)
+GrowingVectorMemory<VECTOR>::free(const VECTOR* const v)
 {
   Threads::ThreadMutex::ScopedLock lock(mutex);
   for (typename std::vector<entry_type>::iterator i=pool.begin();i != pool.end() ;++i)
@@ -268,7 +273,7 @@ GrowingVectorMemory<Vector>::free(const Vector* const v)
          return;
        }
     }
-  Assert(false, typename VectorMemory<Vector>::ExcNotAllocatedHere());
+  Assert(false, typename VectorMemory<VECTOR>::ExcNotAllocatedHere());
 }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.