]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Purge the ProblemBase class. Keep it in tests/big-tests/problem_base.h to allow big...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 27 Mar 2001 14:09:01 +0000 (14:09 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 27 Mar 2001 14:09:01 +0000 (14:09 +0000)
git-svn-id: https://svn.dealii.org/trunk@4304 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/numerics/base.cc [deleted file]
deal.II/doc/news/2001/c-3-1.html
tests/big-tests/convergence/convergence.cc
tests/big-tests/error-estimation/error-estimation.cc
tests/big-tests/nonlinear/fixed-point-iteration/nonlinear.cc
tests/big-tests/poisson/poisson.cc
tests/big-tests/poisson/poisson.h
tests/big-tests/problem_base.h [moved from deal.II/deal.II/include/numerics/base.h with 61% similarity]

diff --git a/deal.II/deal.II/source/numerics/base.cc b/deal.II/deal.II/source/numerics/base.cc
deleted file mode 100644 (file)
index a94cdf9..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-//----------------------------  base.cc  ---------------------------
-//    $Id$
-//    Version: $Name$
-//
-//    Copyright (C) 1998, 1999, 2000, 2001 by the deal.II authors
-//
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
-//
-//----------------------------  base.cc  ---------------------------
-
-
-#include <numerics/assembler.h>
-#include <numerics/base.h>
-#include <numerics/matrices.h>
-#include <numerics/vectors.h>
-#include <dofs/dof_constraints.h>
-#include <grid/tria_iterator.h>
-#include <numerics/data_out.h>
-#include <dofs/dof_tools.h>
-#include <base/function.h>
-#include <fe/fe.h>
-#include <base/quadrature.h>
-#include <lac/vector.h>
-#include <lac/precondition.h>
-#include <lac/solver_cg.h>
-#include <lac/vector_memory.h>
-
-#include <map>
-#include <numeric>
-#include <algorithm>
-#include <cmath>
-
-
-template <int dim>
-ProblemBase<dim>::ProblemBase () :
-               tria(0),
-               dof_handler(0),
-               system_sparsity(),        // dummy initialisation, is later reinit'd
-               system_matrix()           // dummy initialisation, is later reinit'd
-{};
-
-
-template <int dim>
-void ProblemBase<dim>::set_tria_and_dof (Triangulation<dim> *t,
-                                        DoFHandler<dim>    *d)
-{
-  tria        = t;
-  dof_handler = d;
-
-                                  // allow a user to reset both tria and
-                                  // dof to null pointers, but don't allow
-                                  // something other
-  if ((tria != 0) || (dof_handler != 0))
-    {
-      Assert ((tria!=0) && (dof_handler!=0), ExcNoTriaSelected());
-      Assert (tria == &dof_handler->get_tria(), ExcDofAndTriaDontMatch());
-    };
-};
-
-
-template <int dim>
-void ProblemBase<dim>::clear () {
-  if (tria)        { delete tria;         tria        = 0; };
-  if (dof_handler) { delete dof_handler;  dof_handler = 0; };
-  system_sparsity.reinit (0,0,1);
-  system_matrix.clear ();
-  right_hand_side.reinit (0);
-  solution.reinit (0);
-  constraints.clear ();
-};
-
-
-template <int dim>
-ProblemBase<dim>::~ProblemBase () {};
-
-
-template <int dim>
-void ProblemBase<dim>::assemble (const Equation<dim>      &equation,
-                                const Quadrature<dim>    &quadrature,
-                                const UpdateFlags         update_flags,
-                                const FunctionMap        &dirichlet_bc)
-{
-  Assert ((tria!=0) && (dof_handler!=0), ExcNoTriaSelected());
-  
-  system_sparsity.reinit (dof_handler->n_dofs(),
-                         dof_handler->n_dofs(),
-                         dof_handler->max_couplings_between_dofs());
-  right_hand_side.reinit (dof_handler->n_dofs());
-  
-                                  // make up sparsity pattern and
-                                  // compress with constraints
-  constraints.clear ();
-  DoFTools::make_hanging_node_constraints (*dof_handler, constraints);
-  constraints.close ();
-  DoFTools::make_sparsity_pattern (*dof_handler, system_sparsity);
-  constraints.condense (system_sparsity);
-
-                                  // reinite system matrix
-  system_matrix.reinit (system_sparsity);
-                                  // reinit solution vector, preset
-                                  // with zeroes.
-  solution.reinit (dof_handler->n_dofs());
-  
-                                  // create assembler
-  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(),
-                                     &data);
-                                  // loop over all cells, fill matrix and rhs
-  do 
-    {
-      assembler->assemble (equation);
-    }
-  while ((++assembler).state() == valid);
-
-                                  // condense system matrix in-place
-  constraints.condense (system_matrix);
-
-                                  // condense right hand side in-place
-  constraints.condense (right_hand_side);
-
-                                  // apply Dirichlet bc as described
-                                  // in the docs
-  std::map<unsigned int, double> boundary_value_list;
-
-  for (typename FunctionMap::const_iterator dirichlet = dirichlet_bc.begin() ;
-       dirichlet != dirichlet_bc.end() ; ++dirichlet)
-    VectorTools::interpolate_boundary_values (*dof_handler,
-                                             dirichlet->first,
-                                             *(dirichlet->second), 
-                                             boundary_value_list);
-  MatrixTools<dim>::apply_boundary_values (boundary_value_list,
-                                          system_matrix, solution,
-                                          right_hand_side,
-                                          true);
-};
-
-
-template <int dim>
-void ProblemBase<dim>::solve ()
-{
-  Assert ((tria!=0) && (dof_handler!=0), ExcNoTriaSelected());
-  
-  SolverControl           control(4000, 1e-16);
-  PrimitiveVectorMemory<> memory;
-  SolverCG<>              cg(control,memory);
-
-  PreconditionSSOR<> prec;
-  prec.initialize (system_matrix, 1.2);
-
-                                  // solve
-  cg.solve (system_matrix, solution, right_hand_side, prec);
-                                  // distribute solution
-  constraints.distribute (solution);
-};
-
-
-template <int dim>
-void ProblemBase<dim>::fill_data (DataOut<dim> &out) const
-{
-  Assert ((tria!=0) && (dof_handler!=0), ExcNoTriaSelected());
-  
-  out.clear ();
-  out.attach_dof_handler (*dof_handler);
-
-  out.add_data_vector (solution, get_solution_name());
-};
-
-
-template <int dim>
-std::string ProblemBase<dim>::get_solution_name () const
-{
-  return "solution";
-};
-
-
-// explicit instantiations
-template class ProblemBase<deal_II_dimension>;
index 5573d920975d3c14c682507701ac4525b76a1fd1..886e1892038be6b13ef9cd41e4643ea931b036ec 100644 (file)
@@ -281,7 +281,14 @@ documentation, etc</a>.
 
 <ol>
   <li> <p>
+       Removed: the <code class="class">ProblemBase</code> class,
+       which has been deprecated since before the release of 
+       <acronym>deal.II</acronym> 3.0 has finally been removed.
+       <br>
+       (WB 2001/03/27)
        </p>
+
+  <li> <p>
        New: There is now a class <code class="class">MappingC1</code>
        that implements a continous C<sup>1</sup> mapping of the
        boundary by using a cubic mapping with continuous derivatives
@@ -311,7 +318,6 @@ documentation, etc</a>.
        (RH 2001/03/27)
 
   <li> <p>
-       </p>
        New: <code class="class">Boundary</code> and derived classes
        now have a function <code
        class="member">get_tangents_at_vertices</code> that returns a
index 763cec6cd6922307e60a0146654d77ab625c60c0..6d0525c532671df0193baccbe129134b22173f36 100644 (file)
@@ -16,7 +16,7 @@
 #include <numerics/data_out.h>
 #include <fe/fe_lib.lagrange.h>
 #include <base/quadrature_lib.h>
-#include <numerics/base.h>
+#include "../problem_base.h"
 #include <numerics/assembler.h>
 #include <numerics/vectors.h>
 #include <lac/vector.h>
index 8c8f107312b733fc0408809bc316cd50d26c6f81..e11544f3dd21140a732041892be0f24d28577870 100644 (file)
@@ -18,7 +18,7 @@
 #include <dofs/dof_tools.h>
 #include <fe/fe_lib.lagrange.h>
 #include <numerics/data_out.h>
-#include <numerics/base.h>
+#include "../problem_base.h"
 #include <numerics/assembler.h>
 #include <numerics/vectors.h>
 #include <numerics/error_estimator.h>
index aaf36230c8c67f3806211f547fd8ef13d766cc3b..82d023bb61165e0b84050a64d100852b7346a0a2 100644 (file)
@@ -17,7 +17,7 @@
 #include <base/function.h>
 #include <fe/fe_lib.lagrange.h>
 #include <base/quadrature_lib.h>
-#include <numerics/base.h>
+#include "../../problem_base.h"
 #include <numerics/assembler.h>
 #include <numerics/error_estimator.h>
 #include <base/logstream.h>
index bbfa7841ea5a113a31b3de40091c3c2d13b16045..2e647e228a3542afc32f6f61299fdb1828d852cf 100644 (file)
@@ -8,6 +8,7 @@
 #include <base/logstream.h>
 
 
+
 int main (int argc, char **argv) {
   if (argc!=2) 
     {
@@ -27,3 +28,4 @@ int main (int argc, char **argv) {
   
   return 0;
 };
+
index 9fff2c06170ad30235ec0aacc371326b2081a3ad..ce4ea0c407fca1a376be3a057d6cbcb072125356 100644 (file)
@@ -18,7 +18,7 @@
 #include <base/parameter_handler.h>
 #include <fe/fe_lib.lagrange.h>
 #include <base/quadrature_lib.h>
-#include <numerics/base.h>
+#include "../problem_base.h"
 #include <numerics/assembler.h>
 #include <lac/sparse_matrix.h>
 
similarity index 61%
rename from deal.II/deal.II/include/numerics/base.h
rename to tests/big-tests/problem_base.h
index 5de0659be8202bae2b7310bacd3723d4b6d0cdf8..fa5b32c7418605a05db012daf2f8c574f2f00a91 100644 (file)
@@ -1,16 +1,16 @@
-//----------------------------  base.h  ---------------------------
-//    Version: $Name$
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
-//
-//----------------------------  base.h  ---------------------------
+/*----------------------------   problem_base.h     ---------------------------*/
+/* Previously deal.II/include/numerics/base.h and deal.II/source/numerics/base.cc,
+   but deprecated before deal.II version 3.0 and removed after version 3.1
+
+   Kept here to ensure that the example programs in big-tests still
+   compile. It is put into this directory to allow simple access from
+   all the subdirectories.
+*/
+
 #ifndef __deal2__base_h
 #define __deal2__base_h
 
 
-/*----------------------------   problem_base.h     ---------------------------*/
 
 
 #include <lac/sparse_matrix.h>
@@ -248,7 +248,179 @@ class ProblemBase
 };
 
 
-/*----------------------------   problem_base.h     ---------------------------*/
+
+
+#include <numerics/assembler.h>
+#include <numerics/matrices.h>
+#include <numerics/vectors.h>
+#include <dofs/dof_constraints.h>
+#include <grid/tria_iterator.h>
+#include <numerics/data_out.h>
+#include <dofs/dof_tools.h>
+#include <base/function.h>
+#include <fe/fe.h>
+#include <base/quadrature.h>
+#include <lac/vector.h>
+#include <lac/precondition.h>
+#include <lac/solver_cg.h>
+#include <lac/vector_memory.h>
+
+#include <map>
+#include <numeric>
+#include <algorithm>
+#include <cmath>
+
+
+template <int dim>
+ProblemBase<dim>::ProblemBase () :
+               tria(0),
+               dof_handler(0),
+               system_sparsity(),        // dummy initialisation, is later reinit'd
+               system_matrix()           // dummy initialisation, is later reinit'd
+{};
+
+
+template <int dim>
+void ProblemBase<dim>::set_tria_and_dof (Triangulation<dim> *t,
+                                        DoFHandler<dim>    *d)
+{
+  tria        = t;
+  dof_handler = d;
+
+                                  // allow a user to reset both tria and
+                                  // dof to null pointers, but don't allow
+                                  // something other
+  if ((tria != 0) || (dof_handler != 0))
+    {
+      Assert ((tria!=0) && (dof_handler!=0), ExcNoTriaSelected());
+      Assert (tria == &dof_handler->get_tria(), ExcDofAndTriaDontMatch());
+    };
+};
+
+
+template <int dim>
+void ProblemBase<dim>::clear () {
+  if (tria)        { delete tria;         tria        = 0; };
+  if (dof_handler) { delete dof_handler;  dof_handler = 0; };
+  system_sparsity.reinit (0,0,1);
+  system_matrix.clear ();
+  right_hand_side.reinit (0);
+  solution.reinit (0);
+  constraints.clear ();
+};
+
+
+template <int dim>
+ProblemBase<dim>::~ProblemBase () {};
+
+
+template <int dim>
+void ProblemBase<dim>::assemble (const Equation<dim>      &equation,
+                                const Quadrature<dim>    &quadrature,
+                                const UpdateFlags         update_flags,
+                                const FunctionMap        &dirichlet_bc)
+{
+  Assert ((tria!=0) && (dof_handler!=0), ExcNoTriaSelected());
+  
+  system_sparsity.reinit (dof_handler->n_dofs(),
+                         dof_handler->n_dofs(),
+                         dof_handler->max_couplings_between_dofs());
+  right_hand_side.reinit (dof_handler->n_dofs());
+  
+                                  // make up sparsity pattern and
+                                  // compress with constraints
+  constraints.clear ();
+  DoFTools::make_hanging_node_constraints (*dof_handler, constraints);
+  constraints.close ();
+  DoFTools::make_sparsity_pattern (*dof_handler, system_sparsity);
+  constraints.condense (system_sparsity);
+
+                                  // reinite system matrix
+  system_matrix.reinit (system_sparsity);
+                                  // reinit solution vector, preset
+                                  // with zeroes.
+  solution.reinit (dof_handler->n_dofs());
+  
+                                  // create assembler
+  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(),
+                                     &data);
+                                  // loop over all cells, fill matrix and rhs
+  do 
+    {
+      assembler->assemble (equation);
+    }
+  while ((++assembler).state() == valid);
+
+                                  // condense system matrix in-place
+  constraints.condense (system_matrix);
+
+                                  // condense right hand side in-place
+  constraints.condense (right_hand_side);
+
+                                  // apply Dirichlet bc as described
+                                  // in the docs
+  std::map<unsigned int, double> boundary_value_list;
+
+  for (typename FunctionMap::const_iterator dirichlet = dirichlet_bc.begin() ;
+       dirichlet != dirichlet_bc.end() ; ++dirichlet)
+    VectorTools::interpolate_boundary_values (*dof_handler,
+                                             dirichlet->first,
+                                             *(dirichlet->second), 
+                                             boundary_value_list);
+  MatrixTools<dim>::apply_boundary_values (boundary_value_list,
+                                          system_matrix, solution,
+                                          right_hand_side,
+                                          true);
+};
+
+
+template <int dim>
+void ProblemBase<dim>::solve ()
+{
+  Assert ((tria!=0) && (dof_handler!=0), ExcNoTriaSelected());
+  
+  SolverControl           control(4000, 1e-16);
+  PrimitiveVectorMemory<> memory;
+  SolverCG<>              cg(control,memory);
+
+  PreconditionSSOR<> prec;
+  prec.initialize (system_matrix, 1.2);
+
+                                  // solve
+  cg.solve (system_matrix, solution, right_hand_side, prec);
+                                  // distribute solution
+  constraints.distribute (solution);
+};
+
+
+template <int dim>
+void ProblemBase<dim>::fill_data (DataOut<dim> &out) const
+{
+  Assert ((tria!=0) && (dof_handler!=0), ExcNoTriaSelected());
+  
+  out.clear ();
+  out.attach_dof_handler (*dof_handler);
+
+  out.add_data_vector (solution, get_solution_name());
+};
+
+
+template <int dim>
+std::string ProblemBase<dim>::get_solution_name () const
+{
+  return "solution";
+};
+
+
+
 
 #endif
-/*----------------------------   problem_base.h     ---------------------------*/
+

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.