]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
small change in update_solution_and_constraints
authorfrohne <frohne@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 26 Sep 2013 21:39:35 +0000 (21:39 +0000)
committerfrohne <frohne@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 26 Sep 2013 21:39:35 +0000 (21:39 +0000)
git-svn-id: https://svn.dealii.org/trunk@30971 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-42/step-42.cc

index 23550886df088c914f7f984338b78022ca6d67b7..3ee445d4e7561dcebdfadb93bd36bcaefbdde01c 100644 (file)
@@ -1276,7 +1276,12 @@ namespace Step42
   void
   PlasticityContactProblem<dim>::update_solution_and_constraints ()
   {
-    const EquationData::SphereObstacle<dim> obstacle((base_mesh == "box" ? 1.0 : 0.5));
+    Function<dim> *obstacle;
+
+    if (obstacle_filename != "")
+      obstacle = new EquationData::ChineseObstacle<dim>(input_obstacle, (base_mesh == "box" ? 1.0 : 0.5));
+    else
+      obstacle = new EquationData::SphereObstacle<dim>((base_mesh == "box" ? 1.0 : 0.5));
 
 //    const EquationData::ChineseObstacle<dim> obstacle(input_obstacle, (base_mesh == "box" ? 1.0 : 0.5));
 
@@ -1339,7 +1344,7 @@ namespace Step42
                       Point<dim> point(
                         fe_values_face.quadrature_point(q_point));
 
-                      double obstacle_value = obstacle.value(point, 2);
+                      double obstacle_value = obstacle->value(point, 2);
                       double solution_index_z = solution(index_z);
                       double gap = obstacle_value - point(2);
 
@@ -1402,6 +1407,7 @@ namespace Step42
 
     constraints.merge(constraints_dirichlet_hanging_nodes);
 
+    delete obstacle;
     //constraints.print (std::cout);
   }
 

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.