]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Rename make_constraint_matrix to make_hanging_node_constraints (including change...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 15 Apr 1999 13:32:17 +0000 (13:32 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 15 Apr 1999 13:32:17 +0000 (13:32 +0000)
git-svn-id: https://svn.dealii.org/trunk@1148 0785d39b-7218-0410-832d-ea1e28bc413d

12 files changed:
deal.II/deal.II/Attic/examples/dof/dof_test.cc
deal.II/deal.II/Attic/examples/multigrid/multigrid.cc
deal.II/deal.II/include/dofs/dof_handler.h
deal.II/deal.II/include/dofs/dof_levels.h
deal.II/deal.II/include/numerics/assembler.h
deal.II/deal.II/source/dofs/dof_handler.cc
deal.II/deal.II/source/numerics/assembler.cc
deal.II/deal.II/source/numerics/base.cc
deal.II/deal.II/source/numerics/matrices.cc
deal.II/deal.II/source/numerics/vectors.cc
tests/big-tests/dof/dof_test.cc
tests/big-tests/multigrid/multigrid.cc

index 1c6768560139eaac65965c1c73354604496847da..cc8a9f83f524700cd13f3d92c0ce50030fccc51b 100644 (file)
@@ -372,7 +372,8 @@ void TestCases<dim>::run (ParameterHandler &prm) {
                                   // computing constraints
   cout << "    Computing constraints..." << endl;
   ConstraintMatrix constraints;
-  dof->make_constraint_matrix (constraints);
+  dof->make_hanging_node_constraints (constraints);
+  constraints.close ();
   constraints.condense (sparsity);
   
   cout << "    Writing condensed sparsity pattern..." << endl;
index 6270ca3864f3c761c1a840f89e16d4fc0109a9c9..f5433c58994584e8566c91e8e996c9f548d0201b 100644 (file)
@@ -18,6 +18,8 @@
 #include <numerics/assembler.h>
 #include <numerics/vectors.h>
 #include <numerics/matrices.h>
+#include <numerics/multigrid.h>
+#include <numerics/mg_smoother.h>
 
 #include <lac/vector.h>
 #include <lac/sparsematrix.h>
@@ -336,10 +338,16 @@ void PoissonProblem<dim>::assemble (const Equation<dim>      &equation,
                                   // make up sparsity pattern and
                                   // compress with constraints
   constraints.clear ();
-  dof->DoFHandler<dim>::make_constraint_matrix (constraints);
+  dof->DoFHandler<dim>::make_hanging_node_constraints (constraints);
+  constraints.close ();
   dof->DoFHandler<dim>::make_sparsity_pattern (system_sparsity);
   constraints.condense (system_sparsity);
 
+  MGTransferPrebuilt p;
+  p.build_matrices (*dof);
+//  MGSmoother smoother(*dof);
+  
+
                                   // reinite system matrix
   system_matrix.reinit (system_sparsity);
                                   // reinit solution vector, preset
@@ -347,12 +355,12 @@ void PoissonProblem<dim>::assemble (const Equation<dim>      &equation,
   solution.reinit (dof->DoFHandler<dim>::n_dofs());
   
                                   // create assembler
-  AssemblerData<dim> data (*dof,
-                          true, true, //assemble matrix and rhs
-                          system_matrix,
-                          right_hand_side,
-                          quadrature,
-                          update_flags);
+  Assembler<dim>::AssemblerData data (*dof,
+                                     true, true, //assemble matrix and rhs
+                                     system_matrix,
+                                     right_hand_side,
+                                     quadrature,
+                                     update_flags);
   active_assemble_iterator assembler (tria,
                                      tria->begin_active()->level(),
                                      tria->begin_active()->index(),
@@ -416,13 +424,11 @@ int PoissonProblem<dim>::run (const unsigned int level) {
   cout << ">" << endl;
   
   cout << "    Making grid... ";
-  tria->create_hyper_ball ();
-  HyperBallBoundary<dim> boundary_description;
-  tria->set_boundary (&boundary_description);
+  tria->create_hypercube ();
+  tria->refine_global (level+1);
   tria->begin_active()->set_refine_flag();
   (++(++(tria->begin_active())))->set_refine_flag();
   tria->execute_coarsening_and_refinement ();
-  tria->refine_global (level);
   cout << tria->n_active_cells() << " active cells." << endl;
 
   rhs             = new RHSPoly<dim>();
@@ -575,11 +581,14 @@ int PoissonProblem<dim>::run (const unsigned int level) {
   
   cout << endl;
 
+  const unsigned int n_dofs = dof->DoFHandler<dim>::n_dofs();
+  dof->clear ();
+  tria->set_boundary (0);
   delete fe;
   delete quadrature;
   delete boundary_quadrature;
   
-  return dof->DoFHandler<dim>::n_dofs();
+  return n_dofs;
 };
 
 
index 5c8bac32329b9c69e32798864f3f5749d899d043..b32a35c04ac8f8a617f9a2a08e99bd57a6643d95 100644 (file)
@@ -588,8 +588,11 @@ class DoFHandler : public DoFDimensionInfo<dim> {
     void renumber_dofs (const vector<int> &new_numbers);
 
                                     /**
-                                     * Make up the constraint matrix which
-                                     * is used to condensate the global
+                                     * Make up the constraints which
+                                     * is result from the use of hanging
+                                     * nodes. The object into which these
+                                     * are inserted is later
+                                     * used to condensate the global
                                      * system matrices and to prolong
                                      * the solution vectors from the true
                                      * degrees of freedom also to the
@@ -597,21 +600,26 @@ class DoFHandler : public DoFDimensionInfo<dim> {
                                      *
                                      * Since this method does not make sense in
                                      * one dimension, the function returns
-                                     * immediately after clearing the
-                                     * constraint matrix.
-                                     * For more than one dimension, the matrix
-                                     * is cleared before usage. The constraint
-                                     * matrix is closed anyway, no matter of the
-                                     * dimension.
+                                     * immediately. The object is not cleared
+                                     * before use, so you should make sure
+                                     * it containts only constraints you still
+                                     * want; otherwise call the #clear#
+                                     * function.
                                      *
                                      * To condense a given sparsity pattern,
                                      * use #ConstraintMatrix::condense#.
+                                     * Before doing so, you need to close
+                                     * the constraint object, which must be
+                                     * done after all constraints are entered.
+                                     * This function does not close the object
+                                     * since you may want to enter other
+                                     * constraints later on yourself.
                                      *
                                      * This function uses the user flags for
                                      * the faces. If you need the user flags,
                                      * store them beforehand.
                                      */
-    void make_constraint_matrix (ConstraintMatrix &) const;
+    void make_hanging_node_constraints (ConstraintMatrix &) const;
 
 
                                     /**
index 0cb5c84a6e5116ea37fac77119b7582a157b4bd1..e864a533ca1a9fd49a3cdf23f00630c5c16cac71 100644 (file)
@@ -52,7 +52,8 @@ class DoFLevel {
  * $\ldots, u_1^m, u_2^m, u_1^{m+1}, u_2^{m+1},\ldots$ with $m$ denoting the
  * $m$th basis function, or $\ldots, u_1^m, u_1^{m+1}, u_1^{m+2}, \ldots,
  * u_2^m, u_2^{m+1}, u_2^{m+2}, \ldots$, respectively). Likewise, the
- * constraint matrix returned by #DoFHandler::make_constraint_matrix ()# is then
+ * constraint matrix returned by #DoFHandler::make_hanging_node_constraints ()#
+ * is then
  * to be understood as a block matrix.
  *
  * The storage format of the degrees of freedom indices (short: DoF indices) is
index f7fd8135196ed3359b00b18fd1c4d7c20764ac43..dfa367f789740f14d7c0cc2406450a4533543db0 100644 (file)
@@ -124,73 +124,6 @@ class Equation {
 
 
 
-/**
- * Structure to be passed upon
- * construction of an assembler object
- * through the iterator object. See
- * \Ref{TriaRawIterator} for a discussion
- * of this mechanism.
- */
-template <int dim>
-struct AssemblerData {
-                                    /**
-                                     * Constructor.
-                                     */
-    AssemblerData (const DoFHandler<dim>    &dof,
-                  const bool                assemble_matrix,
-                  const bool                assemble_rhs,
-                  SparseMatrix<double>     &matrix,
-                  Vector<double>           &rhs_vector,
-                  const Quadrature<dim>    &quadrature,
-                  const UpdateFlags        &update_flags);
-    
-                                    /**
-                                     * Pointer to the dof handler object
-                                     * to be used to iterate on.
-                                     */
-    const DoFHandler<dim>  &dof;
-    
-                                    /**
-                                     * Flags whether to assemble the matrix
-                                     * and right hand sides.
-                                     */
-    const bool              assemble_matrix, assemble_rhs;
-
-                                    /**
-                                     * Pointer to the matrix to be assembled
-                                     * by this object. Elements are summed
-                                     * up by the assembler, so you may want
-                                     * to clear this object (set all entries
-                                     * to zero) before use.
-                                     */
-    SparseMatrix<double>   &matrix;
-
-                                    /**
-                                     * Pointer to the vector to be assembled
-                                     * by this object. Elements are summed
-                                     * up by the assembler, so you may want
-                                     * to clear this object (set all entries
-                                     * to zero) before use.
-                                     */
-    Vector<double>         &rhs_vector;
-    
-                                    /**
-                                     * Pointer to a quadrature object to be
-                                     * used for this assemblage process.
-                                     */
-    const Quadrature<dim>  &quadrature;
-    
-                                    /**
-                                     * Store which of the fields of the
-                                     * FEValues object need to be reinitialized
-                                     * on each cell.
-                                     */
-    const UpdateFlags       update_flags;
-};
-
-
-
-
 /**
  * An #Assembler# is a specialized version of a #DoFCellAccessor# which adds
  * functionality to assemble global matrices and vectors from cell base ones.
@@ -200,12 +133,78 @@ struct AssemblerData {
 template <int dim>
 class Assembler : public DoFCellAccessor<dim> {
   public:
+
+                                    /**
+                                     * Structure to be passed upon
+                                     * construction of an assembler object
+                                     * through the iterator object. See
+                                     * \Ref{TriaRawIterator} for a discussion
+                                     * of this mechanism.
+                                     */
+    struct AssemblerData {
+                                        /**
+                                         * Constructor.
+                                         */
+       AssemblerData (const DoFHandler<dim>    &dof,
+                      const bool                assemble_matrix,
+                      const bool                assemble_rhs,
+                      SparseMatrix<double>     &matrix,
+                      Vector<double>           &rhs_vector,
+                      const Quadrature<dim>    &quadrature,
+                      const UpdateFlags        &update_flags);
+       
+                                        /**
+                                         * Pointer to the dof handler object
+                                         * to be used to iterate on.
+                                         */
+       const DoFHandler<dim>  &dof;
+       
+                                        /**
+                                         * Flags whether to assemble the matrix
+                                         * and right hand sides.
+                                         */
+       const bool              assemble_matrix, assemble_rhs;
+       
+                                        /**
+                                         * Pointer to the matrix to be assembled
+                                         * by this object. Elements are summed
+                                         * up by the assembler, so you may want
+                                         * to clear this object (set all entries
+                                         * to zero) before use.
+                                         */
+       SparseMatrix<double>   &matrix;
+       
+                                        /**
+                                         * Pointer to the vector to be assembled
+                                         * by this object. Elements are summed
+                                         * up by the assembler, so you may want
+                                         * to clear this object (set all entries
+                                         * to zero) before use.
+                                         */
+       Vector<double>         &rhs_vector;
+       
+                                        /**
+                                         * Pointer to a quadrature object to be
+                                         * used for this assemblage process.
+                                         */
+       const Quadrature<dim>  &quadrature;
+       
+                                        /**
+                                         * Store which of the fields of the
+                                         * FEValues object need to be reinitialized
+                                         * on each cell.
+                                         */
+       const UpdateFlags       update_flags;
+    };
+    
+
+    
                                     /**
                                      * Declare the data type that this accessor
                                      * class expects to get passed from the
                                      * iterator classes.
                                      */
-    typedef AssemblerData<dim> AccessorData;
+    typedef AssemblerData AccessorData;
     
                                     /**
                                      * Default constructor, unused thus not
index b515b8494f613b60caf39e83308cf273642fdec9..982dae0a86f322613cd1375c29bc80d8482f1d26 100644 (file)
@@ -1576,7 +1576,8 @@ void DoFHandler<dim>::renumber_dofs (const RenumberingMethod method,
   if (use_constraints) 
     {
       ConstraintMatrix constraints;
-      make_constraint_matrix (constraints);
+      make_hanging_node_constraints (constraints);
+      constraints.close ();
       constraints.condense (sparsity);
     };
     
@@ -1920,10 +1921,7 @@ void DoFHandler<3>::renumber_dofs (const vector<int> &new_numbers) {
 #if deal_II_dimension == 1
 
 template <>
-void DoFHandler<1>::make_constraint_matrix (ConstraintMatrix &cm) const {
-  cm.clear ();
-  cm.close ();
-};
+void DoFHandler<1>::make_hanging_node_constraints (ConstraintMatrix &) const {};
 
 #endif
 
@@ -1932,11 +1930,9 @@ void DoFHandler<1>::make_constraint_matrix (ConstraintMatrix &cm) const {
 #if deal_II_dimension == 2
 
 template <>
-void DoFHandler<2>::make_constraint_matrix (ConstraintMatrix &constraints) const {
+void DoFHandler<2>::make_hanging_node_constraints (ConstraintMatrix &constraints) const {
   const unsigned int dim = 2;
   
-  constraints.clear ();
-
                                   // first mark all faces which are subject
                                   // to constraints. We do so by looping
                                   // over all active cells and checking
@@ -2013,8 +2009,6 @@ void DoFHandler<2>::make_constraint_matrix (ConstraintMatrix &constraints) const
                                     selected_fe->constraints()(row,i));
          };
       };
-
-  constraints.close ();
 };
 
 #endif
@@ -2024,11 +2018,9 @@ void DoFHandler<2>::make_constraint_matrix (ConstraintMatrix &constraints) const
 #if deal_II_dimension == 3
 
 template <>
-void DoFHandler<3>::make_constraint_matrix (ConstraintMatrix &constraints) const {
+void DoFHandler<3>::make_hanging_node_constraints (ConstraintMatrix &constraints) const {
   const unsigned int dim = 3;
   
-  constraints.clear ();
-
                                   // first mark all faces which are subject
                                   // to constraints. We do so by looping
                                   // over all active cells and checking
@@ -2170,8 +2162,6 @@ void DoFHandler<3>::make_constraint_matrix (ConstraintMatrix &constraints) const
                                     selected_fe->constraints()(row,i));
          };
       };
-
-  constraints.close ();
 };
 
 #endif
index ed7ac2a37ac6c5dd386a5857df970fb14d5bba4d..d6467cc1942657619869771eda9d0ad83b17f1d8 100644 (file)
@@ -47,13 +47,13 @@ void Equation<dim>::assemble (Vector<double>           &,
 
 
 template <int dim>
-AssemblerData<dim>::AssemblerData (const DoFHandler<dim>    &dof,
-                                  const bool                assemble_matrix,
-                                  const bool                assemble_rhs,
-                                  SparseMatrix<double>     &matrix,
-                                  Vector<double>           &rhs_vector,
-                                  const Quadrature<dim>    &quadrature,
-                                  const UpdateFlags        &update_flags) :
+Assembler<dim>::AssemblerData::AssemblerData (const DoFHandler<dim>    &dof,
+                                             const bool                assemble_matrix,
+                                             const bool                assemble_rhs,
+                                             SparseMatrix<double>     &matrix,
+                                             Vector<double>           &rhs_vector,
+                                             const Quadrature<dim>    &quadrature,
+                                             const UpdateFlags        &update_flags) :
                dof(dof),
                assemble_matrix(assemble_matrix),
                assemble_rhs(assemble_rhs),
@@ -67,10 +67,10 @@ AssemblerData<dim>::AssemblerData (const DoFHandler<dim>    &dof,
 
 
 template <int dim>
-Assembler<dim>::Assembler (Triangulation<dim> *tria,
-                          const int           level,
-                          const int           index,
-                          const AssemblerData<dim> *local_data) :
+Assembler<dim>::Assembler (Triangulation<dim>  *tria,
+                          const int            level,
+                          const int            index,
+                          const AssemblerData *local_data) :
                DoFCellAccessor<dim> (tria,level,index, &local_data->dof),
                cell_matrix (dof_handler->get_fe().total_dofs),
                cell_vector (Vector<double>(dof_handler->get_fe().total_dofs)),
@@ -148,7 +148,6 @@ void Assembler<dim>::assemble (const Equation<dim> &equation) {
 // explicit instantiations
 template class Equation<deal_II_dimension>;
 template class Assembler<deal_II_dimension>;
-template class AssemblerData<deal_II_dimension>;
 
 template class TriaRawIterator<deal_II_dimension,Assembler<deal_II_dimension> >;
 template class TriaIterator<deal_II_dimension,Assembler<deal_II_dimension> >;
index 3f25d01f2cff0e0148ae0597bfd181cd8821f695..387be6b1c5139bea0222ac302867a9ea211ed571 100644 (file)
@@ -84,7 +84,8 @@ void ProblemBase<dim>::assemble (const Equation<dim>      &equation,
                                   // make up sparsity pattern and
                                   // compress with constraints
   constraints.clear ();
-  dof_handler->make_constraint_matrix (constraints);
+  dof_handler->make_hanging_node_constraints (constraints);
+  constraints.close ();
   dof_handler->make_sparsity_pattern (system_sparsity);
   constraints.condense (system_sparsity);
 
@@ -95,12 +96,12 @@ void ProblemBase<dim>::assemble (const Equation<dim>      &equation,
   solution.reinit (dof_handler->n_dofs());
   
                                   // create assembler
-  AssemblerData<dim> data (*dof_handler,
-                          true, true, //assemble matrix and rhs
-                          system_matrix,
-                          right_hand_side,
-                          quadrature,
-                          update_flags);
+  Assembler<dim>::AssemblerData data (*dof_handler,
+                                     true, true, //assemble matrix and rhs
+                                     system_matrix,
+                                     right_hand_side,
+                                     quadrature,
+                                     update_flags);
   active_assemble_iterator assembler (tria,
                                      tria->begin_active()->level(),
                                      tria->begin_active()->index(),
index 6b237b7d43a7e6e1ac71dc02c17c56089fa86cc4..9f71473f8f6dd419b0e01f27f42b98c597d959ec 100644 (file)
@@ -28,10 +28,10 @@ void MatrixCreator<dim>::create_mass_matrix (const DoFHandler<dim>    &dof,
   UpdateFlags update_flags = update_JxW_values;
   if (a != 0)
     update_flags = UpdateFlags (update_flags | update_q_points);
-  const AssemblerData<dim> data (dof,
-                                true, false,  // assemble matrix but not rhs
-                                matrix, dummy,
-                                q, update_flags);
+  const Assembler<dim>::AssemblerData data (dof,
+                                           true, false,  // assemble matrix but not rhs
+                                           matrix, dummy,
+                                           q, update_flags);
   TriaActiveIterator<dim, Assembler<dim> >
     assembler (const_cast<Triangulation<dim>*>(&dof.get_tria()),
               dof.get_tria().begin_active()->level(),
@@ -57,10 +57,10 @@ void MatrixCreator<dim>::create_mass_matrix (const DoFHandler<dim>    &dof,
                                             const Function<dim> * const a) {
   UpdateFlags update_flags = UpdateFlags(update_q_points |
                                         update_JxW_values);
-  const AssemblerData<dim> data (dof,
-                                true, true,
-                                matrix, rhs_vector,
-                                q, update_flags);
+  const Assembler<dim>::AssemblerData data (dof,
+                                           true, true,
+                                           matrix, rhs_vector,
+                                           q, update_flags);
   TriaActiveIterator<dim, Assembler<dim> >
     assembler (const_cast<Triangulation<dim>*>(&dof.get_tria()),
               dof.get_tria().begin_active()->level(),
@@ -323,10 +323,10 @@ void MatrixCreator<dim>::create_laplace_matrix (const DoFHandler<dim>    &dof,
                                         update_JxW_values);
   if (a != 0)
     update_flags = UpdateFlags(update_flags | update_q_points);
-  const AssemblerData<dim> data (dof,
-                                true, false,  // assemble matrix but not rhs
-                                matrix, dummy,
-                                q, update_flags);
+  const Assembler<dim>::AssemblerData data (dof,
+                                           true, false,  // assemble matrix but not rhs
+                                           matrix, dummy,
+                                           q, update_flags);
   TriaActiveIterator<dim, Assembler<dim> >
     assembler (const_cast<Triangulation<dim>*>(&dof.get_tria()),
               dof.get_tria().begin_active()->level(),
@@ -352,10 +352,10 @@ void MatrixCreator<dim>::create_laplace_matrix (const DoFHandler<dim>    &dof,
   UpdateFlags update_flags = UpdateFlags(update_q_points  |
                                         update_gradients |
                                         update_JxW_values);
-  const AssemblerData<dim> data (dof,
-                                true, true,
-                                matrix, rhs_vector,
-                                q, update_flags);
+  const Assembler<dim>::AssemblerData data (dof,
+                                           true, true,
+                                           matrix, rhs_vector,
+                                           q, update_flags);
   TriaActiveIterator<dim, Assembler<dim> >
     assembler (const_cast<Triangulation<dim>*>(&dof.get_tria()),
               dof.get_tria().begin_active()->level(),
index 6faf714ff5df4c2fed397b77f8f4be4bd778f6d0..bc6767ce412b485ba9ca23d792b5435a0ea81056 100644 (file)
@@ -220,10 +220,10 @@ void VectorTools<dim>::create_right_hand_side (const DoFHandler<dim>    &dof,
   UpdateFlags update_flags = UpdateFlags(update_q_points |
                                         update_JxW_values);
   SparseMatrix<double> dummy;
-  const AssemblerData<dim> data (dof,
-                                false, true,
-                                dummy, rhs_vector,
-                                quadrature, update_flags);
+  const Assembler<dim>::AssemblerData data (dof,
+                                           false, true,
+                                           dummy, rhs_vector,
+                                           quadrature, update_flags);
   TriaActiveIterator<dim, Assembler<dim> >
     assembler (const_cast<Triangulation<dim>*>(&dof.get_tria()),
               dof.get_tria().begin_active()->level(),
@@ -360,7 +360,7 @@ void
 VectorTools<dim>::project_boundary_values (const DoFHandler<dim>    &dof,
                                           const FunctionMap        &boundary_functions,
                                           const Quadrature<dim-1>  &q,
-                                          map<int,double>   &boundary_values) {
+                                          map<int,double>          &boundary_values) {
   vector<int>    dof_to_boundary_mapping;
   dof.map_dof_to_boundary_indices (boundary_functions, dof_to_boundary_mapping);
   
index 1c6768560139eaac65965c1c73354604496847da..cc8a9f83f524700cd13f3d92c0ce50030fccc51b 100644 (file)
@@ -372,7 +372,8 @@ void TestCases<dim>::run (ParameterHandler &prm) {
                                   // computing constraints
   cout << "    Computing constraints..." << endl;
   ConstraintMatrix constraints;
-  dof->make_constraint_matrix (constraints);
+  dof->make_hanging_node_constraints (constraints);
+  constraints.close ();
   constraints.condense (sparsity);
   
   cout << "    Writing condensed sparsity pattern..." << endl;
index 6270ca3864f3c761c1a840f89e16d4fc0109a9c9..f5433c58994584e8566c91e8e996c9f548d0201b 100644 (file)
@@ -18,6 +18,8 @@
 #include <numerics/assembler.h>
 #include <numerics/vectors.h>
 #include <numerics/matrices.h>
+#include <numerics/multigrid.h>
+#include <numerics/mg_smoother.h>
 
 #include <lac/vector.h>
 #include <lac/sparsematrix.h>
@@ -336,10 +338,16 @@ void PoissonProblem<dim>::assemble (const Equation<dim>      &equation,
                                   // make up sparsity pattern and
                                   // compress with constraints
   constraints.clear ();
-  dof->DoFHandler<dim>::make_constraint_matrix (constraints);
+  dof->DoFHandler<dim>::make_hanging_node_constraints (constraints);
+  constraints.close ();
   dof->DoFHandler<dim>::make_sparsity_pattern (system_sparsity);
   constraints.condense (system_sparsity);
 
+  MGTransferPrebuilt p;
+  p.build_matrices (*dof);
+//  MGSmoother smoother(*dof);
+  
+
                                   // reinite system matrix
   system_matrix.reinit (system_sparsity);
                                   // reinit solution vector, preset
@@ -347,12 +355,12 @@ void PoissonProblem<dim>::assemble (const Equation<dim>      &equation,
   solution.reinit (dof->DoFHandler<dim>::n_dofs());
   
                                   // create assembler
-  AssemblerData<dim> data (*dof,
-                          true, true, //assemble matrix and rhs
-                          system_matrix,
-                          right_hand_side,
-                          quadrature,
-                          update_flags);
+  Assembler<dim>::AssemblerData data (*dof,
+                                     true, true, //assemble matrix and rhs
+                                     system_matrix,
+                                     right_hand_side,
+                                     quadrature,
+                                     update_flags);
   active_assemble_iterator assembler (tria,
                                      tria->begin_active()->level(),
                                      tria->begin_active()->index(),
@@ -416,13 +424,11 @@ int PoissonProblem<dim>::run (const unsigned int level) {
   cout << ">" << endl;
   
   cout << "    Making grid... ";
-  tria->create_hyper_ball ();
-  HyperBallBoundary<dim> boundary_description;
-  tria->set_boundary (&boundary_description);
+  tria->create_hypercube ();
+  tria->refine_global (level+1);
   tria->begin_active()->set_refine_flag();
   (++(++(tria->begin_active())))->set_refine_flag();
   tria->execute_coarsening_and_refinement ();
-  tria->refine_global (level);
   cout << tria->n_active_cells() << " active cells." << endl;
 
   rhs             = new RHSPoly<dim>();
@@ -575,11 +581,14 @@ int PoissonProblem<dim>::run (const unsigned int level) {
   
   cout << endl;
 
+  const unsigned int n_dofs = dof->DoFHandler<dim>::n_dofs();
+  dof->clear ();
+  tria->set_boundary (0);
   delete fe;
   delete quadrature;
   delete boundary_quadrature;
   
-  return dof->DoFHandler<dim>::n_dofs();
+  return n_dofs;
 };
 
 

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.