From: Jonathan Robey Date: Sat, 6 Aug 2016 06:49:09 +0000 (-0700) Subject: Replace deprecated MGConstrainedDoFs::initialize in examples X-Git-Tag: v8.5.0-rc1~796^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41a68c483af27310a615ae3d73964f8ad14b3aa6;p=dealii.git Replace deprecated MGConstrainedDoFs::initialize in examples --- diff --git a/examples/step-16/step-16.cc b/examples/step-16/step-16.cc index 592698e958..a169b50d5f 100644 --- a/examples/step-16/step-16.cc +++ b/examples/step-16/step-16.cc @@ -288,8 +288,10 @@ namespace Step16 DoFTools::make_hanging_node_constraints (dof_handler, hanging_node_constraints); DoFTools::make_hanging_node_constraints (dof_handler, constraints); + std::set dirichlet_boundary_ids; typename FunctionMap::type dirichlet_boundary_functions; ZeroFunction homogeneous_dirichlet_bc (1); + dirichlet_boundary_ids.insert(0); dirichlet_boundary_functions[0] = &homogeneous_dirichlet_bc; VectorTools::interpolate_boundary_values (static_cast&>(dof_handler), dirichlet_boundary_functions, @@ -304,7 +306,8 @@ namespace Step16 // about the boundary values as well, so we pass the // dirichlet_boundary here as well. mg_constrained_dofs.clear(); - mg_constrained_dofs.initialize(dof_handler, dirichlet_boundary_functions); + mg_constrained_dofs.initialize(dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(dof_handler, dirichlet_boundary_ids); // Now for the things that concern the multigrid data structures. First, diff --git a/examples/step-50/step-50.cc b/examples/step-50/step-50.cc index a91498016f..2491e9692c 100644 --- a/examples/step-50/step-50.cc +++ b/examples/step-50/step-50.cc @@ -287,8 +287,10 @@ namespace Step50 DoFTools::make_hanging_node_constraints (mg_dof_handler, hanging_node_constraints); DoFTools::make_hanging_node_constraints (mg_dof_handler, constraints); + std::set dirichlet_boundary_ids; typename FunctionMap::type dirichlet_boundary; ConstantFunction homogeneous_dirichlet_bc (1.0); + dirichlet_boundary_ids.insert(0); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; VectorTools::interpolate_boundary_values (mg_dof_handler, dirichlet_boundary, @@ -307,7 +309,8 @@ namespace Step50 // pass the dirichlet_boundary // here as well. mg_constrained_dofs.clear(); - mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); + mg_constrained_dofs.initialize(mg_dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(mg_dof_handler, dirichlet_boundary_ids); // Now for the things that concern the diff --git a/examples/step-56/step-56.cc b/examples/step-56/step-56.cc index 3dc2bc378c..f16cd6c523 100644 --- a/examples/step-56/step-56.cc +++ b/examples/step-56/step-56.cc @@ -554,12 +554,12 @@ namespace Step56 // sparsity patterns and matrices for each level. The resize() // function of MGLevelObject will destroy all existing contained // objects. - typename FunctionMap::type boundary_condition_function_map; - BoundaryValuesForVelocity velocity_boundary_condition; - boundary_condition_function_map[0] = &velocity_boundary_condition; + std::set zero_boundary_ids; + zero_boundary_ids.insert(0); mg_constrained_dofs.clear(); - mg_constrained_dofs.initialize(velocity_dof_handler, boundary_condition_function_map); + mg_constrained_dofs.initialize(velocity_dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(velocity_dof_handler, zero_boundary_ids); const unsigned int n_levels = triangulation.n_levels(); mg_interface_matrices.resize(0, n_levels-1);