]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Delete objects in the right order.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 16 Nov 1998 16:53:16 +0000 (16:53 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 16 Nov 1998 16:53:16 +0000 (16:53 +0000)
git-svn-id: https://svn.dealii.org/trunk@669 0785d39b-7218-0410-832d-ea1e28bc413d

12 files changed:
deal.II/deal.II/Attic/examples/dof/dof_test.cc
deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc
deal.II/deal.II/Attic/examples/multigrid/multigrid.cc
deal.II/deal.II/Attic/examples/poisson/Makefile
deal.II/deal.II/Attic/examples/poisson/equation.cc
deal.II/deal.II/Attic/examples/poisson/problem.cc
tests/big-tests/dof/dof_test.cc
tests/big-tests/error-estimation/error-estimation.cc
tests/big-tests/multigrid/multigrid.cc
tests/big-tests/poisson/Makefile
tests/big-tests/poisson/equation.cc
tests/big-tests/poisson/problem.cc

index 15b5395016de381612394713ae3d24eadc523e9b..c4fc5358abf2ef37271c656335f87192c77e13a5 100644 (file)
@@ -99,8 +99,8 @@ TestCases<dim>::TestCases () :
 
 template <int dim>
 void TestCases<dim>::create_new (const unsigned int) {
-  if (tria != 0) delete tria;
   if (dof  != 0) delete dof;
+  if (tria != 0) delete tria;
 
   tria = new Triangulation<dim>();
   tria->create_hypercube();
index c83757d28a569b76c7e1f08576b42b06d740c643..ab3c7b49333e58c358c8ffda3d5c2012fb650d88 100644 (file)
@@ -306,8 +306,8 @@ PoissonProblem<dim>::PoissonProblem () :
 
 template <int dim>
 void PoissonProblem<dim>::clear () {
-  if (tria != 0)              { delete tria;              tria = 0;              };
   if (dof != 0)               { delete dof;               dof = 0;               };
+  if (tria != 0)              { delete tria;              tria = 0;              };
   if (rhs != 0)               { delete rhs;               rhs = 0;               };
   if (solution_function != 0) { delete solution_function; solution_function = 0; };
   if (coefficient != 0)       { delete coefficient;       coefficient = 0;       };
index 657f3c61fad9cb9b47f2366cd31b83ea9a1f4f0f..a6451bfd1d88cf2085a1aff15f276dcef701ca30 100644 (file)
@@ -271,17 +271,17 @@ PoissonProblem<dim>::PoissonProblem (unsigned int order) :
 
 
 template <int dim>
-void PoissonProblem<dim>::clear () {
-  if (tria != 0) {
-    delete tria;
-    tria = 0;
-  };
-  
+void PoissonProblem<dim>::clear () {  
   if (dof != 0) {
     delete dof;
     dof = 0;
   };
 
+  if (tria != 0) {
+    delete tria;
+    tria = 0;
+  };
+
   if (rhs != 0) 
     {
       delete rhs;
index ba6405c2a215ebc0e60587a1e00ee2b8bd1107fd..fe1e05124b96b38123cd72b27fb184f745d797e2 100644 (file)
@@ -11,7 +11,7 @@ target   = poisson
 # the archives ./Obj.a and ./Obj.g.a. By default, the debug version
 # is used to link. It you don't like that, change the following
 # variable to "off"
-debug-mode = off
+debug-mode = on
 
 # If you want your program to be linked with extra object or library
 # files, specify them here:
index e30bfefa7677925b7c708998665549615a707194..915b92a52caa11491647b8b6bb1f2ad8394cbfad 100644 (file)
@@ -9,6 +9,7 @@
 
 #if deal_II_dimension == 1
 
+template <>
 void PoissonEquation<1>::assemble (dFMatrix            &cell_matrix,
                                   dVector             &rhs,
                                   const FEValues<1>   &fe_values,
@@ -32,6 +33,7 @@ void PoissonEquation<1>::assemble (dFMatrix            &cell_matrix,
 
 #if deal_II_dimension == 2
 
+template <>
 void PoissonEquation<2>::assemble (dFMatrix            &cell_matrix,
                                   dVector             &rhs,
                                   const FEValues<2>   &fe_values,
index 68096f524e584f399f05dd12ca54e80554331b4f..e24b5d1affdd67505fdb0c8e03c4fb18aaa2d6a8 100644 (file)
@@ -163,17 +163,18 @@ PoissonProblem<dim>::PoissonProblem () :
 
 
 template <int dim>
-void PoissonProblem<dim>::clear () {
-  if (tria != 0) {
-    delete tria;
-    tria = 0;
-  };
-  
+void PoissonProblem<dim>::clear () {  
   if (dof != 0) {
     delete dof;
     dof = 0;
   };
 
+  if (tria != 0) {
+    delete tria;
+    tria = 0;
+  };
+
+
   if (rhs != 0) 
     {
       delete rhs;
index 15b5395016de381612394713ae3d24eadc523e9b..c4fc5358abf2ef37271c656335f87192c77e13a5 100644 (file)
@@ -99,8 +99,8 @@ TestCases<dim>::TestCases () :
 
 template <int dim>
 void TestCases<dim>::create_new (const unsigned int) {
-  if (tria != 0) delete tria;
   if (dof  != 0) delete dof;
+  if (tria != 0) delete tria;
 
   tria = new Triangulation<dim>();
   tria->create_hypercube();
index c83757d28a569b76c7e1f08576b42b06d740c643..ab3c7b49333e58c358c8ffda3d5c2012fb650d88 100644 (file)
@@ -306,8 +306,8 @@ PoissonProblem<dim>::PoissonProblem () :
 
 template <int dim>
 void PoissonProblem<dim>::clear () {
-  if (tria != 0)              { delete tria;              tria = 0;              };
   if (dof != 0)               { delete dof;               dof = 0;               };
+  if (tria != 0)              { delete tria;              tria = 0;              };
   if (rhs != 0)               { delete rhs;               rhs = 0;               };
   if (solution_function != 0) { delete solution_function; solution_function = 0; };
   if (coefficient != 0)       { delete coefficient;       coefficient = 0;       };
index 657f3c61fad9cb9b47f2366cd31b83ea9a1f4f0f..a6451bfd1d88cf2085a1aff15f276dcef701ca30 100644 (file)
@@ -271,17 +271,17 @@ PoissonProblem<dim>::PoissonProblem (unsigned int order) :
 
 
 template <int dim>
-void PoissonProblem<dim>::clear () {
-  if (tria != 0) {
-    delete tria;
-    tria = 0;
-  };
-  
+void PoissonProblem<dim>::clear () {  
   if (dof != 0) {
     delete dof;
     dof = 0;
   };
 
+  if (tria != 0) {
+    delete tria;
+    tria = 0;
+  };
+
   if (rhs != 0) 
     {
       delete rhs;
index ba6405c2a215ebc0e60587a1e00ee2b8bd1107fd..fe1e05124b96b38123cd72b27fb184f745d797e2 100644 (file)
@@ -11,7 +11,7 @@ target   = poisson
 # the archives ./Obj.a and ./Obj.g.a. By default, the debug version
 # is used to link. It you don't like that, change the following
 # variable to "off"
-debug-mode = off
+debug-mode = on
 
 # If you want your program to be linked with extra object or library
 # files, specify them here:
index e30bfefa7677925b7c708998665549615a707194..915b92a52caa11491647b8b6bb1f2ad8394cbfad 100644 (file)
@@ -9,6 +9,7 @@
 
 #if deal_II_dimension == 1
 
+template <>
 void PoissonEquation<1>::assemble (dFMatrix            &cell_matrix,
                                   dVector             &rhs,
                                   const FEValues<1>   &fe_values,
@@ -32,6 +33,7 @@ void PoissonEquation<1>::assemble (dFMatrix            &cell_matrix,
 
 #if deal_II_dimension == 2
 
+template <>
 void PoissonEquation<2>::assemble (dFMatrix            &cell_matrix,
                                   dVector             &rhs,
                                   const FEValues<2>   &fe_values,
index 68096f524e584f399f05dd12ca54e80554331b4f..e24b5d1affdd67505fdb0c8e03c4fb18aaa2d6a8 100644 (file)
@@ -163,17 +163,18 @@ PoissonProblem<dim>::PoissonProblem () :
 
 
 template <int dim>
-void PoissonProblem<dim>::clear () {
-  if (tria != 0) {
-    delete tria;
-    tria = 0;
-  };
-  
+void PoissonProblem<dim>::clear () {  
   if (dof != 0) {
     delete dof;
     dof = 0;
   };
 
+  if (tria != 0) {
+    delete tria;
+    tria = 0;
+  };
+
+
   if (rhs != 0) 
     {
       delete rhs;

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.