]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Wrong order of elimination of hanging nodes and boundary values.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 12 Jan 2000 10:35:59 +0000 (10:35 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 12 Jan 2000 10:35:59 +0000 (10:35 +0000)
git-svn-id: https://svn.dealii.org/trunk@2209 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/Attic/examples/step-by-step/step-6/step-6.cc
deal.II/examples/step-6/step-6.cc

index d24f349852f5233fbfb7ed2f0656f83d012793fc..fe4ed33a89512cb235eeaa0604406436889149c1 100644 (file)
@@ -519,21 +519,6 @@ void LaplaceProblem<dim>::assemble_system ()
        };
     };
 
-                                  // As almost all the stuff before,
-                                  // the interpolation of boundary
-                                  // values works also for higher
-                                  // order elements, but you need not
-                                  // change your code for that:
-  map<int,double> boundary_values;
-  VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<dim>(),
-                                           boundary_values);
-  MatrixTools<dim>::apply_boundary_values (boundary_values,
-                                          system_matrix,
-                                          solution,
-                                          system_rhs);
-
                                   // After the system of equations
                                   // has been assembled just as for
                                   // the previous examples, we still
@@ -557,6 +542,27 @@ void LaplaceProblem<dim>::assemble_system ()
                                   // are invalid. They are set to
                                   // reasonable values in the
                                   // ``solve'' function.
+
+                                  // As almost all the stuff before,
+                                  // the interpolation of boundary
+                                  // values works also for higher
+                                  // order elements, but you need not
+                                  // change your code for that. We
+                                  // note that for proper results, it
+                                  // is important that the
+                                  // elimination of boundary nodes
+                                  // from the system of equations
+                                  // happens *after* the elimination
+                                  // of hanging nodes.
+  map<int,double> boundary_values;
+  VectorTools::interpolate_boundary_values (dof_handler,
+                                           0,
+                                           ZeroFunction<dim>(),
+                                           boundary_values);
+  MatrixTools<dim>::apply_boundary_values (boundary_values,
+                                          system_matrix,
+                                          solution,
+                                          system_rhs);
 };
 
 
index d24f349852f5233fbfb7ed2f0656f83d012793fc..fe4ed33a89512cb235eeaa0604406436889149c1 100644 (file)
@@ -519,21 +519,6 @@ void LaplaceProblem<dim>::assemble_system ()
        };
     };
 
-                                  // As almost all the stuff before,
-                                  // the interpolation of boundary
-                                  // values works also for higher
-                                  // order elements, but you need not
-                                  // change your code for that:
-  map<int,double> boundary_values;
-  VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<dim>(),
-                                           boundary_values);
-  MatrixTools<dim>::apply_boundary_values (boundary_values,
-                                          system_matrix,
-                                          solution,
-                                          system_rhs);
-
                                   // After the system of equations
                                   // has been assembled just as for
                                   // the previous examples, we still
@@ -557,6 +542,27 @@ void LaplaceProblem<dim>::assemble_system ()
                                   // are invalid. They are set to
                                   // reasonable values in the
                                   // ``solve'' function.
+
+                                  // As almost all the stuff before,
+                                  // the interpolation of boundary
+                                  // values works also for higher
+                                  // order elements, but you need not
+                                  // change your code for that. We
+                                  // note that for proper results, it
+                                  // is important that the
+                                  // elimination of boundary nodes
+                                  // from the system of equations
+                                  // happens *after* the elimination
+                                  // of hanging nodes.
+  map<int,double> boundary_values;
+  VectorTools::interpolate_boundary_values (dof_handler,
+                                           0,
+                                           ZeroFunction<dim>(),
+                                           boundary_values);
+  MatrixTools<dim>::apply_boundary_values (boundary_values,
+                                          system_matrix,
+                                          solution,
+                                          system_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.