From 84f00d5e3332cd75fcd64d0c370d0c8be85febe6 Mon Sep 17 00:00:00 2001 From: frohne Date: Thu, 26 Sep 2013 21:39:35 +0000 Subject: [PATCH] small change in update_solution_and_constraints git-svn-id: https://svn.dealii.org/trunk@30971 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-42/step-42.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/deal.II/examples/step-42/step-42.cc b/deal.II/examples/step-42/step-42.cc index 23550886df..3ee445d4e7 100644 --- a/deal.II/examples/step-42/step-42.cc +++ b/deal.II/examples/step-42/step-42.cc @@ -1276,7 +1276,12 @@ namespace Step42 void PlasticityContactProblem::update_solution_and_constraints () { - const EquationData::SphereObstacle obstacle((base_mesh == "box" ? 1.0 : 0.5)); + Function *obstacle; + + if (obstacle_filename != "") + obstacle = new EquationData::ChineseObstacle(input_obstacle, (base_mesh == "box" ? 1.0 : 0.5)); + else + obstacle = new EquationData::SphereObstacle((base_mesh == "box" ? 1.0 : 0.5)); // const EquationData::ChineseObstacle obstacle(input_obstacle, (base_mesh == "box" ? 1.0 : 0.5)); @@ -1339,7 +1344,7 @@ namespace Step42 Point 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); } -- 2.39.5