]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
make GrowingVectorMemory default
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 17 Dec 2007 20:16:08 +0000 (20:16 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 17 Dec 2007 20:16:08 +0000 (20:16 +0000)
git-svn-id: https://svn.dealii.org/trunk@15606 0785d39b-7218-0410-832d-ea1e28bc413d

13 files changed:
deal.II/deal.II/include/numerics/vectors.templates.h
deal.II/deal.II/source/grid/grid_generator.cc
deal.II/examples/step-20/step-20.cc
deal.II/lac/include/lac/filtered_matrix.h
deal.II/lac/include/lac/solver.h
deal.II/lac/include/lac/solver_bicgstab.h
deal.II/lac/include/lac/solver_cg.h
deal.II/lac/include/lac/solver_gmres.h
deal.II/lac/include/lac/solver_minres.h
deal.II/lac/include/lac/solver_qmrs.h
deal.II/lac/include/lac/solver_richardson.h
deal.II/lac/source/solver.cc
deal.II/lac/source/vector_memory.inst.in

index c5aade3845b97f80f87e2463affb2ceb2e48da57..2a1c3167141743445312f21f0130f965f7a06bd7 100644 (file)
@@ -461,7 +461,7 @@ void VectorTools::project (const Mapping<dim>       &mapping,
                                   // errors may accumulate for badly
                                   // conditioned matrices
   ReductionControl        control(5*tmp.size(), 0., 1e-12, false, false);
-  PrimitiveVectorMemory<> memory;
+  GrowingVectorMemory<> memory;
   SolverCG<>              cg(control,memory);
 
   PreconditionSSOR<> prec;
@@ -1784,7 +1784,7 @@ VectorTools::project_boundary_values (const Mapping<dim>       &mapping,
                                   // errors may accumulate for badly
                                   // conditioned matrices
   ReductionControl        control(5*rhs.size(), 0., 1.e-12, false, false);
-  PrimitiveVectorMemory<> memory;
+  GrowingVectorMemory<> memory;
   SolverCG<>              cg(control,memory);
 
   PreconditionSSOR<> prec;
index bca963cf9828ee41eda63f4704a4e6987a4ccefd..b437e0adf7a84f40f9f044d234f6faf1f9770e8a 100644 (file)
@@ -2293,7 +2293,7 @@ void GridGenerator::laplace_solve (const SparseMatrix<double> &S,
   FilteredMatrix<Vector<double> > PF (prec);
   
   SolverControl control (1000, 1.e-10, false, false);
-  PrimitiveVectorMemory<Vector<double> > mem;
+  GrowingVectorMemory<Vector<double> > mem;
   SolverCG<Vector<double> > solver (control, mem);
   
   Vector<double> f(n_dofs);
index 68a274fd7384d1f7982e6ef39005071c45dfe572..fccd4a2d4f853be01d6a191d653a26aafa86c146 100644 (file)
@@ -817,16 +817,10 @@ void MixedLaplaceProblem<dim>::assemble_system ()
                                  // management in the API reference
                                  // manual). By default, the linear
                                  // solvers use a derived class
-                                 // <code>PrimitiveVectorMemory</code> that,
+                                 // <code>GrowingVectorMemory</code> that,
                                  // ever time a vector is requested,
-                                 // allocates one using <code>new</code>, and
-                                 // calls <code>delete</code> on it again once
-                                 // the solver returns it to the
-                                 // <code>PrimitiveVectorMemory</code>
-                                 // object. This is the appropriate
-                                 // thing to do if we do not
-                                 // anticipate that the vectors may be
-                                 // reused any time soon.
+                                 // allocates one from its internal
+                                 // pool.
                                  //
                                  // On the other hand, for the present
                                  // case, we would like to have a
@@ -887,7 +881,8 @@ class InverseMatrix : public Subscriptor
 
   private:
     const SmartPointer<const Matrix> matrix;
-
+//TODO: GrowingVectorMemory is now the default and it can be created
+//where needed. Adjust documentation and implementation here
     mutable GrowingVectorMemory<> vector_memory;    
 };
 
index 66ac47db6be74d39d9c20accfd86e6444b0abd39..f382e8d2d02e96957ae3a36ae0e6ed138165659c 100644 (file)
@@ -77,7 +77,7 @@ template <typename number> class Vector;
  *
  *                     // set up a linear solver
  *   SolverControl control (1000, 1.e-10, false, false);
- *   PrimitiveVectorMemory<Vector<double> > mem;
+ *   GrowingVectorMemory<Vector<double> > mem;
  *   SolverCG<Vector<double> > solver (control, mem);
  *
  *                     // set up a preconditioner object
index f35718cc66564b94bfc86da1a8a39b320e981863..efc54b8f8e9bd10fce5e8d7e014064665e978dd7 100644 (file)
@@ -166,7 +166,7 @@ class Solver : public Subscriptor
                                      * contrast to the other
                                      * constructor, this constructor
                                      * denotes an internal object of
-                                     * type PrimitiveVectorMemory to
+                                     * type GrowingVectorMemory to
                                      * allocate memory.
                                      *
                                      * A reference to the control
@@ -192,7 +192,7 @@ class Solver : public Subscriptor
                                      * object has been given to the
                                      * constructor.
                                      */
-    static PrimitiveVectorMemory<VECTOR> static_vector_memory;
+    mutable GrowingVectorMemory<VECTOR> static_vector_memory;
     
                                     /**
                                      * Control structure.
index 64f29a331ba12f63ac26e39e9fe04d389281bfe5..440b34d92dfa3a5aa1d3c971b9634826eb87f580 100644 (file)
@@ -105,7 +105,7 @@ class SolverBicgstab : public Solver<VECTOR>
 
                                     /**
                                      * Constructor. Use an object of
-                                     * type PrimitiveVectorMemory as
+                                     * type GrowingVectorMemory as
                                      * a default to allocate memory.
                                      */
     SolverBicgstab (SolverControl        &cn,
index 092126246ce15fefff856be37ac5a63d00031fef..fd2b11955a97142874f401d034575677b0782f5d 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -131,7 +131,7 @@ class SolverCG : public Solver<VECTOR>
 
                                     /**
                                      * Constructor. Use an object of
-                                     * type PrimitiveVectorMemory as
+                                     * type GrowingVectorMemory as
                                      * a default to allocate memory.
                                      */
     SolverCG (SolverControl        &cn,
index 9256bb7f08e05416429323d0b01ed17e364e5505..9ffe75872aa8649a81e4db9648b51bf3df50697c 100644 (file)
@@ -231,7 +231,7 @@ class SolverGMRES : public Solver<VECTOR>
 
                                     /**
                                      * Constructor. Use an object of
-                                     * type PrimitiveVectorMemory as
+                                     * type GrowingVectorMemory as
                                      * a default to allocate memory.
                                      */
     SolverGMRES (SolverControl        &cn,
@@ -353,7 +353,7 @@ class SolverFGMRES : public Solver<VECTOR>
 
                                     /**
                                      * Constructor. Use an object of
-                                     * type PrimitiveVectorMemory as
+                                     * type GrowingVectorMemory as
                                      * a default to allocate memory.
                                      */
     SolverFGMRES (SolverControl        &cn,
index 6cd97f9ee46045d295cc9b79462856712503474e..b355b04ced0383135e95e226631dbc03d12193aa 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -78,7 +78,7 @@ class SolverMinRes : public Solver<VECTOR>
 
                                     /**
                                      * Constructor. Use an object of
-                                     * type PrimitiveVectorMemory as
+                                     * type GrowingVectorMemory as
                                      * a default to allocate memory.
                                      */
     SolverMinRes (SolverControl        &cn,
index 446e50e415f629de177f86782b1f9be81414c58c..28b401fad0d0fb501b62c3116f6404249ab8f093 100644 (file)
@@ -118,7 +118,7 @@ class SolverQMRS : public Solver<VECTOR>
 
                                     /**
                                      * Constructor. Use an object of
-                                     * type PrimitiveVectorMemory as
+                                     * type GrowingVectorMemory as
                                      * a default to allocate memory.
                                      */
     SolverQMRS (SolverControl        &cn,
index 4c4fbf508d1c6ea6a398866aa4b1fb5990093336..13f5494329bb9d10680135f28ec7f3d705f373db 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -87,7 +87,7 @@ class SolverRichardson : public Solver<VECTOR>
 
                                     /**
                                      * Constructor. Use an object of
-                                     * type PrimitiveVectorMemory as
+                                     * type GrowingVectorMemory as
                                      * a default to allocate memory.
                                      */
     SolverRichardson (SolverControl        &cn,
index 28aa36305b607a164dc9414761483999a41fa0fd..ceaf76a0c72bc35846d5b657120d794ac622be6f 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006 by the deal.II authors
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -24,10 +24,6 @@ DEAL_II_NAMESPACE_OPEN
 // a few instantiations of static members. Hope that we catch all that
 // are required
 
-template <class VECTOR>
-PrimitiveVectorMemory<VECTOR>
-Solver<VECTOR>::static_vector_memory;
-
 template class Solver<Vector<double> >;
 template class Solver<BlockVector<double> >;
 
index 220711a78b5a6be70eaceb368064311d8db47df9..406a44be096baebe3d4d7e5e0c58a5fc3c4e163b 100644 (file)
@@ -1,5 +1,5 @@
 //---------------------------------------------------------------------------
-//    $Id: vector.cc 15443 2007-11-05 03:43:52Z bangerth $
+//    $Id$
 //    Version: $Name$
 //
 //    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
@@ -25,3 +25,16 @@ for (SCALAR : REAL_SCALARS)
 //      GrowingVectorMemory<BlockVector<SCALAR> >::pool;
   }
 
+for (SCALAR : COMPLEX_SCALARS)
+  {
+    template class VectorMemory<Vector<SCALAR> >;
+    template class GrowingVectorMemory<Vector<SCALAR> >;
+//    template GrowingVectorMemory<Vector<SCALAR> >::Pool
+//      GrowingVectorMemory<Vector<SCALAR> >::pool;
+
+    template class VectorMemory<BlockVector<SCALAR> >;
+    template class GrowingVectorMemory<BlockVector<SCALAR> >;
+//    template GrowingVectorMemory<BlockVector<SCALAR> >::Pool
+//      GrowingVectorMemory<BlockVector<SCALAR> >::pool;
+  }
+

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.