]> https://gitweb.dealii.org/ - dealii.git/commitdiff
step-8: make setup more like step-6.
authorDavid Wells <drwells@email.unc.edu>
Fri, 17 Apr 2020 15:07:01 +0000 (11:07 -0400)
committerDavid Wells <drwells@email.unc.edu>
Fri, 17 Apr 2020 15:27:12 +0000 (11:27 -0400)
examples/step-8/step-8.cc

index dd95346468f68b3947545a062d9bce458e14a924..86ddbf978ffd9b16bb4e0fcdf39008de15c35630 100644 (file)
@@ -222,6 +222,9 @@ namespace Step8
   void ElasticProblem<dim>::setup_system()
   {
     dof_handler.distribute_dofs(fe);
+    solution.reinit(dof_handler.n_dofs());
+    system_rhs.reinit(dof_handler.n_dofs());
+
     constraints.clear();
     DoFTools::make_hanging_node_constraints(dof_handler, constraints);
     VectorTools::interpolate_boundary_values(dof_handler,
@@ -238,9 +241,6 @@ namespace Step8
     sparsity_pattern.copy_from(dsp);
 
     system_matrix.reinit(sparsity_pattern);
-
-    solution.reinit(dof_handler.n_dofs());
-    system_rhs.reinit(dof_handler.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.