]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
dependence on forward_declarations.h removed for speed
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 24 May 2000 22:32:42 +0000 (22:32 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 24 May 2000 22:32:42 +0000 (22:32 +0000)
git-svn-id: https://svn.dealii.org/trunk@2941 0785d39b-7218-0410-832d-ea1e28bc413d

39 files changed:
deal.II/deal.II/include/dofs/dof_accessor.h
deal.II/deal.II/include/dofs/dof_constraints.h
deal.II/deal.II/include/dofs/dof_handler.h
deal.II/deal.II/include/dofs/dof_tools.h
deal.II/deal.II/include/fe/fe_values.h
deal.II/deal.II/include/grid/grid_generator.h
deal.II/deal.II/include/grid/grid_in.h
deal.II/deal.II/include/grid/grid_out.h
deal.II/deal.II/include/grid/intergrid_map.h
deal.II/deal.II/include/grid/tria.h
deal.II/deal.II/include/grid/tria_accessor.h
deal.II/deal.II/include/grid/tria_boundary.h
deal.II/deal.II/include/grid/tria_iterator.h
deal.II/deal.II/include/multigrid/mg_base.h
deal.II/deal.II/include/multigrid/mg_dof_accessor.h
deal.II/deal.II/include/multigrid/mg_dof_handler.h
deal.II/deal.II/include/multigrid/mg_dof_tools.h
deal.II/deal.II/include/multigrid/mg_smoother.h
deal.II/deal.II/include/numerics/base.h
deal.II/deal.II/include/numerics/data_io.h
deal.II/deal.II/include/numerics/data_out.h
deal.II/deal.II/include/numerics/data_out_stack.h
deal.II/deal.II/include/numerics/dof_renumbering.h
deal.II/deal.II/include/numerics/error_estimator.h
deal.II/deal.II/include/numerics/matrices.h
deal.II/deal.II/include/numerics/vectors.h
deal.II/deal.II/source/multigrid/mg_base.cc
deal.II/lac/include/lac/block_sparse_matrix.h
deal.II/lac/include/lac/block_sparsity_pattern.h
deal.II/lac/include/lac/eigen.h
deal.II/lac/include/lac/precondition_block.h
deal.II/lac/include/lac/precondition_block.templates.h
deal.II/lac/include/lac/solver.h
deal.II/lac/include/lac/solver_selector.h
deal.II/lac/include/lac/sparse_matrix.h
deal.II/lac/include/lac/sparse_vanka.h
deal.II/lac/include/lac/sparsity_pattern.h
deal.II/lac/source/precondition_block.cc
tests/deal.II/mglocal.cc

index ffbd26e55d4bbfda5d8ee23c5bad8fe838759ce3..95cdffd9c15a7641b0736d9b86addf098475599f 100644 (file)
 
 
 #include <grid/tria_accessor.h>
-#include <lac/forward_declarations.h>
 #include <vector>
 
+template <typename number> class FullMatrix;
+template <typename number> class SparseMatrix;
+template <typename number> class Vector;
+
+template <int dim> class DoFHandler;
 
 // note: in non-debug mode, i.e. with optimizations, the file
 // dof_accessor.templates.h is included at the end of this file.
index 0dd6b3c9b4e8e50a62566335dc7404dd324edfad..71ec847299a73f5bcb52dd87e3ec1aeb48b79a7d 100644 (file)
 #include <utility>
 #include <base/exceptions.h>
 #include <base/subscriptor.h>
-#include <lac/forward_declarations.h>
 
+class SparsityPattern;
+template <int rows, int columns> class BlockSparsityPattern;
+template <typename number> class SparseMatrix;
+template <typename number, int rows, int columns> class BlockSparseMatrix;
+template <int n_blocks> class BlockIndices;
 
 /**
  * This class represents the matrix denoting the distribution of the degrees
index 16313096340b11d0f5df8f00282ceaee519d9ccb..5aa4eddf704e9edc06774e1e91f0c3f369f23246 100644 (file)
 #include <vector>
 #include <map>
 #include <base/exceptions.h>
-#include <base/forward_declarations.h>
 #include <base/smartpointer.h>
-#include <grid/forward_declarations.h>
-#include <lac/forward_declarations.h>
 
+template <int dim> class Function;
+
+template <int dim> class DoFCellAccessor;
+template <int dim> class DoFLevel;
+template<int celldim, int dim> class DoFObjectAccessor;
+template <int dim> class FiniteElement;
+template <int dim, typename Accessor> class TriaRawIterator;
+template <int dim, typename Accessor> class TriaIterator;
+template <int dim, typename Accessor> class TriaActiveIterator;
+template <int dim> class Triangulation;
 
 /**
  * Define some types which differ between the dimensions. This class
index af6dc71a7a7487981d5a2d3d8a59b9d4e3009db8..2332048219d962e150ef3124f10e07c3099c8281 100644 (file)
 
 
 #include <base/exceptions.h>
-#include <lac/forward_declarations.h>
-#include <grid/forward_declarations.h>
 #include <vector>
 
+template <int dim> class MGDoFHandler;
+template <template <int> class GridClass, int dim> class InterGridMap;
 
 /**
  * This is a collection of functions operating on, and manipulating
index 164d08023e6c4cbd6487238aeb62af34af5406d3..633f7957209d926a26623ceccf09ab766870e496 100644 (file)
@@ -23,6 +23,8 @@
 #include <grid/tria.h>
 #include <fe/fe_update_flags.h>
 
+template <int dim> class Quadrature;
+
 
 /**
  *  This class offers a multitude of arrays and other fields which are used by
index 471af52af374259e51386c3939dfbc725b0fe3a7..f447a670cf4fb764886a6f92dea352546ab7f8e3 100644 (file)
 #define __deal2__grid_generator_h
 
 
-#include <base/forward_declarations.h>
-#include <grid/forward_declarations.h>
 #include <base/exceptions.h>
 
+template <int dim> class Point;
+template <int dim> class Triangulation;
+
 
 /**
  * This class offers triangulations of some standard domains such as hypercubes,
index fee29e5cd0717988b27327cb2311cfceca3cc214..e7c87afa09054d015d972f7b6dee0a0f44622a8e 100644 (file)
 
 #include <base/exceptions.h>
 #include <base/smartpointer.h>
-#include <grid/forward_declarations.h>
 #include <iostream>
 #include <vector>
 #include <string>
 
+template <int dim> class Triangulation;
 
 /**
  * This class implements an input mechanism for grid data. It allows to
index e16c1439b0d8de6a77931ed5f5969cf143c5a2bd..1fa6704210196e3020434606c5e593abcd89ff7c 100644 (file)
 #define __deal2__grid_out_h
 
 
-#include <grid/forward_declarations.h>
 #include <base/exceptions.h>
 #include <string>
 
+template <int dim> class Triangulation;
 
 /**
  * This class provides a means to output a triangulation to a file in different
index cdd90bd5a3758947c5ca8659d0f89fb97b071733..65f5078082b9410cfab21ba2ac26b2d4e41a1c30 100644 (file)
@@ -13,6 +13,7 @@
 #ifndef __deal2__intergrid_map_h
 #define __deal2__intergrid_map_h
 
+template <class T> class SmartPointer;
 
 /**
  * This class provides a map between two grids which are derived from
index 4440d63a95f3dbd894b4d4ce093e7d3aa2d09f6a..25f37423b116de12ec0e6d8ea0bb9b948fbdd5ad 100644 (file)
 
 
 #include <vector>
-#include <grid/forward_declarations.h>
-#include <lac/forward_declarations.h>
-#include <base/forward_declarations.h>
 #include <base/point.h>
 #include <grid/geometry_info.h>
 #include <base/subscriptor.h>
 
+template <int dim> class Boundary;
+template <int dim> class StraightBoundary;
+template <int dim> class CellAccessor;
+template<int celldim, int dim> class TriaObjectAccessor;
+template <int dim, typename Accessor> class TriaRawIterator;
+template <int dim, typename Accessor> class TriaIterator;
+template <int dim, typename Accessor> class TriaActiveIterator;
+template <int dim> class TriangulationLevel;
+template <int dim> class DoFHandler;
+template <int dim> class MGDoFHandler;
+
 /*------------------------------------------------------------------------*/
 
 
index 7c3d454eba8d89c313da6442125e19321a86feb8..7f1cefe083b943212e1da5831bd87b19779dd82d 100644 (file)
 
 
 #include <base/exceptions.h>
-#include <base/forward_declarations.h>
-#include <grid/forward_declarations.h>
 #include <grid/tria_iterator_base.h>
 
+template <int dim> class Point;
+
+template <int dim> class Triangulation;
+template <int dim, typename Accessor> class TriaRawIterator;
+template <int dim, typename Accessor> class TriaIterator;
+template <int dim, typename Accessor> class TriaActiveIterator;
+class Line;
+class Quad;
+class Hexahedron;
+
 
 // note: in non-debug mode, i.e. with optimizations, the file
 // tria_accessor.templates.h is included at the end of this file.
@@ -65,7 +73,6 @@ class TriaAccessor
                    present_index (index),
                    tria (parent) {};
 
-
                                     /**
                                      *  Copy operator. Since this is only
                                      *  called from iterators, do not
index 4d0ed02d824577132f4dcadac88a02ac1af0316e..dd6cd2681207ef373b6e623dd4e10f744f1caf62 100644 (file)
@@ -19,8 +19,8 @@
 #include <base/point.h>
 #include <base/subscriptor.h>
 #include <grid/geometry_info.h>
-#include <grid/forward_declarations.h>
 
+template <int dim> class Triangulation;
 
 /**
  *   This class is used to represent a boundary to a triangulation.
index e194bd4e8d99ee4da3fb84a52fc67f44e2ed16a1..c28a6feece251065e63ca8fd8e6946c422b3c947 100644 (file)
@@ -22,8 +22,8 @@
 #include <base/exceptions.h>
 #include <base/point.h>
 #include <grid/tria_iterator_base.h>
-#include <grid/forward_declarations.h>
 
+template <int dim> class Triangulation;
 
 // note: in non-debug mode, i.e. with optimizations, the file
 // tria_iterator.templates.h is included at the end of this file.
index 4e0396528e5d6ab1b915afe5e640f2a44d24ea7c..b53705d6b5ebeb72636d81c3181420c5b24cfd8a 100644 (file)
 #include <base/smartpointer.h>
 #include <lac/vector.h>
 
-#include <lac/forward_declarations.h>
-#include <grid/forward_declarations.h>
-
 #include <vector>
 
+class MGSmootherBase;
+
 
 /**
  * An array with an object for each level.  The purpose of this class
index bd9eb7900893a19e6507c61b5ba7336abbb29020..0ddec9695274442b1e346c0d212be26600aa7d09 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <dofs/dof_accessor.h>
 
+template <int dim> class MGDoFHandler;
 
 /**
  * Define the basis for accessors to the degrees of freedom for
index 287d9322c16cd500f913133e7f5e0fabbb7f3594..4db78746b61b6d302b561363bb5904a5bc52b4f3 100644 (file)
@@ -19,6 +19,8 @@
 
 #include <dofs/dof_handler.h>
 
+template <int dim> class MGDoFCellAccessor;
+template <int celldim, int dim> class MGDoFObjectAccessor;
 
 /**
  * Define some types which differ between the dimensions. This class
index 5c23a77418ed3ccee360137661b221839118416a..d4da86b4410d9774cdc2e13f3acdd1db9c6cb29d 100644 (file)
@@ -14,9 +14,6 @@
 #define __deal2__mg_dof_tools_h
 
 
-#include <lac/forward_declarations.h>
-#include <grid/forward_declarations.h>
-
 //TODO: Consider incorporating these functions in DoFTools
 
 /**
index aff3374722e0dde65f069c076ff60b5f37aadf2a..dd5dc9b3c87f748df0cdcae8e66c8393aa244041 100644 (file)
 
 #include <lac/forward_declarations.h>
 #include <multigrid/mg_base.h>
-#include <grid/forward_declarations.h>
 #include <base/smartpointer.h>
 #include <vector>
 
+template <int dim> class MGDoFHandler;
 
 /**
  * Abstract base class for multigrid smoothers.
index b4ba0b01ab4e656789f0dec19d19215bea917476..b91856b5fe167fa5f97bc6161e666b6e70499078 100644 (file)
@@ -24,6 +24,8 @@
 #include <map>
 #include <string>
 
+template <int dim> class DataOut;
+
 
 /**
  * The use of this class is now deprecated!
index 4ddbbc247afc86726e023a12d2c46444b9b367d6..acf4d72503f9f93066811d6df3930370399f298b 100644 (file)
 
 
 #include <base/exceptions.h>
-#include <grid/forward_declarations.h>
-#include <lac/forward_declarations.h>
 #include <vector>
 #include <string>
 
+template <typename number> class Vector;
+template <int dim> class DoFHandler;
+class EpsOutputData;
 
 /**
  * This class is deprecated. Use the #DataOut# class instead.
index bf647770e84cd506486619598c6c3e38647914bd..490584367f4f8f0b8a9f8226c753b7921ddf3a1b 100644 (file)
 #define __deal2__data_out_h
 
 
-#include <lac/forward_declarations.h>
-#include <grid/forward_declarations.h>
 #include <base/data_out_base.h>
 #include <base/multithread_info.h>
 
 
+template <int dim> class DoFHandler;
 
 /**
  * This is an abstract class which provides the functionality to generate
index 0289205e753f965a20d4362902e06d83966944c6..1bb1ec1b891617ffb42554632ef85081ceb7e167 100644 (file)
 
 
 #include <base/data_out_base.h>
-#include <lac/forward_declarations.h>
-#include <grid/forward_declarations.h>
 #include <base/smartpointer.h>
 
 #include <string>
 #include <vector>
 
+template <int dim> class DoFHandler;
 
 /**
  * This class is used to stack the output from several computations
index a92c5772393fb93f9efc390309d17de5653fba60..5c195929a5ef8134efff09080e37d09f01371231 100644 (file)
@@ -15,7 +15,6 @@
 
 
 #include <base/exceptions.h>
-#include <grid/forward_declarations.h>
 
 
 /**
index 0d00c620cf17baa04538bf8b788417db8168f064..b3bf3528b4b7bbe7e161824a64514472e343cf1f 100644 (file)
@@ -17,7 +17,6 @@
 #include <base/exceptions.h>
 #include <base/function.h>
 #include <base/multithread_info.h>
-#include <grid/forward_declarations.h>
 #include <dofs/dof_handler.h>
 #include <map>
 
index 9e5ecfaa721eccffbdc60290c41f8fcfa5db7835..15bd54c8757caaa2f23afc390a2ac908022531f5 100644 (file)
 #include <base/exceptions.h>
 #include <map>
 
+template <int dim> class Quadrature;
+
+template<typename number> class Vector;
+template<typename number> class FullMatrix;
+template<typename number> class SparseMatrix;
+
+template <typename number, int rows, int columns  >  class BlockSparseMatrix;
+template <int n_blocks, typename Number> class BlockVector;
+template <int dim> class FEValues;
+template <int dim> class Equation;
 
 /**
  * Provide a class which assembles certain standard matrices for a given
index 3b2e82bffd622fadcb77d5e5ba0431b577b70b0f..b5d64ff3f5ca96be1dce77959420657dae273c82 100644 (file)
 #define __deal2__vectors_h
 
 
-#include <base/forward_declarations.h>
 #include <base/exceptions.h>
-#include <lac/forward_declarations.h>
-#include <grid/forward_declarations.h>
 #include <map>
 #include <vector>
 
+template <int dim> class Function;
+template <int dim> class Quadrature;
+template <int dim> class QGauss2;
+
+template <typename number> class Vector;
+template <typename number> class FullMatrix;
+template <int dim> class DoFHandler;
+class ConstraintMatrix;
+
 
 /**
  *  Denote which norm/integral is to be computed. The following possibilities
index cc3bd3c2549f0bbe34bc3cf4f02a299e8763e95a..6dd37906b105f2dd36c2eec9351dd958d0fa248c 100644 (file)
@@ -53,18 +53,21 @@ MGBase::level_mgstep(const unsigned int        level,
                     const MGSmootherBase     &post_smooth,
                     const MGCoarseGridSolver &coarse_grid_solver)
 {
+#ifdef MG_DEBUG
   char *name = new char[100];
-
   sprintf(name, "MG%d-defect",level);
   print_vector(level, defect[level], name);
-  
+#endif
+
   solution[level] = 0.;
   
   if (level == minlevel)
     {
       coarse_grid_solver(level, solution[level], defect[level]);
+#ifdef MG_DEBUG
       sprintf(name, "MG%d-solution",level);
       print_vector(level, solution[level], name);
+#endif
       return;
     }
 
@@ -72,8 +75,10 @@ MGBase::level_mgstep(const unsigned int        level,
   pre_smooth.smooth(level, solution[level], defect[level]);
                                   // t = d-As
 
+#ifdef MG_DEBUG
   sprintf(name, "MG%d-pre",level);
   print_vector(level, solution[level], name);
+#endif
   
   t.reinit(solution[level].size());
   level_vmult(level, t, solution[level], defect[level]);
@@ -96,8 +101,10 @@ MGBase::level_mgstep(const unsigned int        level,
 
   transfer->prolongate(level, t, solution[level-1]);
 
+#ifdef MG_DEBUG
   sprintf(name, "MG%d-cgc",level);
   print_vector(level, t, name);
+#endif
 
   solution[level] += t;
   
@@ -105,10 +112,12 @@ MGBase::level_mgstep(const unsigned int        level,
 
   post_smooth.smooth(level, solution[level], defect[level]);
 
+#ifdef MG_DEBUG
   sprintf(name, "MG%d-post",level);
   print_vector(level, solution[level], name);
 
   delete[] name;
+#endif
 }
 
 
index 60065927702ffe7a30a591279504c8092d475d97..58bd47d816a3a354800e19d2f5c5048a175c5149 100644 (file)
@@ -17,7 +17,7 @@
 #include <lac/sparse_matrix.h>
 #include <lac/block_sparsity_pattern.h>
 
-
+template <int n_blocks, typename Number> class BlockVector;
 
 /**
  * Blocked sparse matrix. The behaviour of objects of this type is
index 7a46e28a0768b4fa4a347b3282032ca2aa9253b4..621400829e12574d20e9de165f31cd8382c8b809 100644 (file)
@@ -16,7 +16,6 @@
 
 #include <base/exceptions.h>
 #include <base/subscriptor.h>
-#include <lac/forward_declarations.h>
 #include <lac/sparsity_pattern.h>
 #include <lac/block_indices.h>
 
index e9489ccae5fe0a11cbcbf9453da4f05bdea88adb..6293e808632d84a4c89fcaca326a798fe1b4f7dd 100644 (file)
@@ -14,7 +14,6 @@
 #define __deal2__eigen_h
 
 
-#include <lac/forward_declarations.h>
 #include <lac/solver.h>
 #include <lac/solver_control.h>
 #include <lac/solver_cg.h>
index 071d4df14b66397f38ab54d512dc4b229fefa6a9..bc45f9e90782084883fc976b5df29e0e549b09eb 100644 (file)
 #define __deal2__precondition_block_h
 
 
-#include <lac/forward_declarations.h>
 #include <base/exceptions.h>
 #include <base/subscriptor.h>
 #include <base/smartpointer.h>
 
 #include <vector>
 
+template <typename number> class FullMatrix;
+template <typename number> class SparseMatrix;
+template <typename number> class Vector;
+
 
 /**
  * Base class for #PreconditionBlockJacobi#, #PreconditionBlockSOR#, ...
@@ -213,6 +216,33 @@ class PreconditionBlock: public Subscriptor
 };
 
 
+/**
+ * Block Jacobi preconditioning.
+ */
+template<typename number,
+         typename inverse_type = number>
+class PreconditionBlockJacobi : public PreconditionBlock<number,inverse_type>
+{
+  public:
+                                    /**
+                                     * Execute block Jacobi preconditioning.
+                                     * Make sure that the right
+                                     * block size
+                                     * of the matrix is set by
+                                     * #set_block_size#
+                                     * before calling this function.
+                                     *
+                                     * This function will automatically use the
+                                     * inverse matrices if they exist, if not
+                                     * then BlockJacobi will need much time
+                                     * inverting the diagonal block
+                                     * matrices in each preconditioning step.
+                                     */
+    template <typename number2>
+    void operator() (Vector<number2>&, const Vector<number2>&) const;
+};
+
+
 /**
  * Block SOR preconditioning.
  *
index 1a299727cf3df9a151cfe90bbcfdf982e8e4855c..62d8d5170aaed456e6eba69c726b1afebaef7229 100644 (file)
@@ -124,6 +124,71 @@ void PreconditionBlock<number,inverse_type>::invert_diagblocks()
 }
 
 
+/*--------------------- PreconditionBlockJacobi -----------------------*/
+
+
+template <typename number, typename inverse_type>
+template <typename number2>
+void PreconditionBlockJacobi<number,inverse_type>
+::operator() (Vector<number2>       &dst,
+             const Vector<number2> &src) const
+{
+  Assert(A!=0, ExcNoMatrixGivenToUse());
+  const SparseMatrix<number> &M=*A;
+  Assert (M.m() == M.n(), ExcMatrixNotSquare());
+  Assert (blocksize!=0, ExcBlockSizeNotSet());
+  Assert (M.m()%blocksize==0, ExcWrongBlockSize(blocksize, M.m()));
+  const unsigned int n_cells=M.m()/blocksize;
+  Assert (inverse.size()==0 || inverse.size()==n_cells,
+         ExcWrongNumberOfInverses(inverse.size(), n_cells));
+
+  Vector<number2> b_cell(blocksize), x_cell(blocksize);
+
+                                      // cell_row, cell_column are the
+                                      // numbering of the blocks (cells).
+                                      // row_cell, column_cell are the local
+                                      // numbering of the unknowns in the
+                                      // blocks.
+                                      // row, column are the global numbering
+                                      // of the unkowns.
+  unsigned int row, row_cell, begin_diag_block=0;
+
+  if (inverse.size()==0)
+    {
+      FullMatrix<number> M_cell(blocksize);
+      for (unsigned int cell=0; cell<n_cells; ++cell)
+       {
+         for (row=cell*blocksize, row_cell=0; row_cell<blocksize; ++row_cell, ++row)
+           {
+             b_cell(row_cell)=src(row);
+             for (unsigned int column_cell=0, column=cell*blocksize;
+                  column_cell<blocksize; ++column_cell, ++column)
+               M_cell(row_cell,column_cell)=M(row,column);
+           }
+         M_cell.householder(b_cell);
+         M_cell.backward(x_cell,b_cell);
+                                          // distribute x_cell to dst
+         for (row=cell*blocksize, row_cell=0; row_cell<blocksize; ++row_cell, ++row)
+           dst(row)=x_cell(row_cell);
+         
+         begin_diag_block+=blocksize;
+       }
+    }
+  else
+    for (unsigned int cell=0; cell<n_cells; ++cell)
+      {
+       for (row=cell*blocksize, row_cell=0; row_cell<blocksize; ++row_cell, ++row)
+         {
+           b_cell(row_cell)=src(row);
+         }
+       inverse[cell].vmult(x_cell, b_cell);
+                                        // distribute x_cell to dst
+       for (row=cell*blocksize, row_cell=0; row_cell<blocksize; ++row_cell, ++row)
+         dst(row)=x_cell(row_cell);
+       
+       begin_diag_block+=blocksize;
+      }
+}
 /*--------------------- PreconditionBlockSOR -----------------------*/
 
 template<typename number, typename inverse_type>
index 88156952e9633d260ac0c09a0258df884d54077b..cd90d8a030af1f2ac7bf11adc7410b807bcddcf7 100644 (file)
@@ -13,8 +13,9 @@
 #ifndef __deal2__solver_h
 #define __deal2__solver_h
 
-
-#include <lac/forward_declarations.h>
+template<typename number> class Vector;
+template<class VECTOR>  class VectorMemory;
+class SolverControl;
 
 
 /**
index 1122e2a704674747451bf76b22ff0b921eb24718..2c1aa5087b27307e3f776448b320685bd4d5c3f5 100644 (file)
@@ -25,7 +25,6 @@
 #include <lac/vector_memory.h>
 #include <lac/solver_richardson.h>
 #include <lac/precondition.h>
-#include <lac/forward_declarations.h>
 
 
 /**
index e31c9da1d228b98c618d62657a506b01c3940855..9e55810b5293690225b0776b3af93b16a1bfd9a5 100644 (file)
@@ -22,6 +22,7 @@
 #include <base/smartpointer.h>
 #include <lac/sparsity_pattern.h>
 
+template<typename number> class Vector;
 
 /**
  * Sparse matrix.
index 74427cc2ade5d37a4773871a4bf37cdab5846e1e..cb318d9b9468029c53dd581d9220ebf01b4f5f89 100644 (file)
 
 #include <base/smartpointer.h>
 #include <base/multithread_info.h>
-#include <lac/forward_declarations.h>
 
 #include <vector>
 #include <map>
 
+template <typename number> class FullMatrix;
+template <typename number> class SparseMatrix;
+template <typename number> class Vector;
 
 /**
  * Point-wise Vanka preconditioning.
index 08825dacc84a440f7d627e112b9acece44933043..b4e07c66edb68fa9e74c2d6b1fa80c179d661ed1 100644 (file)
@@ -16,7 +16,8 @@
 
 #include <base/exceptions.h>
 #include <base/subscriptor.h>
-#include <lac/forward_declarations.h>
+
+template <typename number> class SparseMatrix;
 
 #include <vector>
 
index 823b11b63827f221775256547e8edbd25f689628..d94b57ac28e1902988db9fa7aee5423a9d5ab627 100644 (file)
@@ -29,6 +29,32 @@ template class PreconditionBlock<double, float>;
 template class PreconditionBlock<double, double>;
 
 
+/*--------------------- PreconditionBlockJacobi -----------------------*/
+
+
+// explicit instantiations for "float" PreconditionBlock
+template class PreconditionBlockJacobi<float, float>;
+
+template void PreconditionBlockJacobi<float, float>::operator() (
+  Vector<float> &, const Vector<float> &) const;
+template void PreconditionBlockJacobi<float, float>::operator() (
+  Vector<double> &, const Vector<double> &) const;
+
+
+template class PreconditionBlockJacobi<double, float>;
+
+template void PreconditionBlockJacobi<double, float>::operator() (
+  Vector<float> &, const Vector<float> &) const;
+template void PreconditionBlockJacobi<double, float>::operator() (
+  Vector<double> &, const Vector<double> &) const;
+
+template class PreconditionBlockJacobi<double, double>;
+
+template void PreconditionBlockJacobi<double, double>::operator() (
+  Vector<float> &, const Vector<float> &) const;
+template void PreconditionBlockJacobi<double, double>::operator() (
+  Vector<double> &, const Vector<double> &) const;
+
 /*--------------------- PreconditionBlockGaussSeidel -----------------------*/
 
 
index e2294b4372fe7e93872d04e54db23ce6da37fbcc..b91aa923b36098ff64559073a932a78050ef1280 100644 (file)
@@ -72,6 +72,7 @@ int main()
 //  logfile.setf(ios::fixed);
 //  logfile.precision (3);
   deallog.attach(logfile);
+  deallog.log_execution_time(true);
 //  deallog.depth_console(0);
 
   Helmholtz equation;
@@ -82,7 +83,7 @@ int main()
   FEQ2<2> fe2;
   FEQ3<2> fe3;
   FEQ4<2> fe4;
-  for (unsigned int degree=1;degree<=4;degree++)
+  for (unsigned int degree=1;degree<=3;degree++)
     {
       Triangulation<2> tr;
       MGDoFHandler<2> mgdof(tr);
@@ -104,12 +105,12 @@ int main()
       cell->set_refine_flag();
       tr.execute_coarsening_and_refinement();
 
-      tr.refine_global(2);
+      tr.refine_global(1);
       dof.distribute_dofs(*fe);
       const unsigned int size = dof.n_dofs();
       deallog << "DoFs " << size << endl;
       deallog << "Levels: " << tr.n_levels() << endl;
-      for (unsigned int step=14;step < 15; ++step)
+      for (unsigned int step=1;step < 3; ++step)
        {
          deallog << "smoothing-steps" << step << endl;
          SparsityPattern structure(size, dof.max_couplings_between_dofs());
@@ -143,7 +144,8 @@ int main()
          Vector<double> u;
          u.reinit(f);
          PrimitiveVectorMemory<> mem;
-         SolverControl control(20, 1.e-8, true);
+
+         SolverControl control(20, 1.e-12, true);
          SolverCG<> solver(control, mem);
          
          MGLevelObject<SparsityPattern> mgstruct(0, tr.n_levels()-1);

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.