]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Replace deprecated MGConstrainedDoFs::initialize in examples
authorJonathan Robey <class4kayaker@gmail.com>
Sat, 6 Aug 2016 06:49:09 +0000 (23:49 -0700)
committerJonathan Robey <class4kayaker@gmail.com>
Sat, 6 Aug 2016 23:08:21 +0000 (16:08 -0700)
examples/step-16/step-16.cc
examples/step-50/step-50.cc
examples/step-56/step-56.cc

index 592698e958329d6c656ffdd991a7840c1f08d6b6..a169b50d5fae43646015b483d7c8e2e1560f7464 100644 (file)
@@ -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<types::boundary_id>         dirichlet_boundary_ids;
     typename FunctionMap<dim>::type      dirichlet_boundary_functions;
     ZeroFunction<dim>                    homogeneous_dirichlet_bc (1);
+    dirichlet_boundary_ids.insert(0);
     dirichlet_boundary_functions[0] = &homogeneous_dirichlet_bc;
     VectorTools::interpolate_boundary_values (static_cast<const DoFHandler<dim>&>(dof_handler),
                                               dirichlet_boundary_functions,
@@ -304,7 +306,8 @@ namespace Step16
     // about the boundary values as well, so we pass the
     // <code>dirichlet_boundary</code> 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,
index a91498016f631081ef8843a653fe8c4c9b3dc8e0..2491e9692ca96f8630794e553abcda719828c837 100644 (file)
@@ -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<types::boundary_id>         dirichlet_boundary_ids;
     typename FunctionMap<dim>::type      dirichlet_boundary;
     ConstantFunction<dim>                    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 <code>dirichlet_boundary</code>
     // 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
index 3dc2bc378ceea2bd6ce07100cfe5cca6e946f97b..f16cd6c523efaff6f910b15d276f4f53957a2406 100644 (file)
@@ -554,12 +554,12 @@ namespace Step56
         // sparsity patterns and matrices for each level. The resize()
         // function of MGLevelObject<T> will destroy all existing contained
         // objects.
-        typename FunctionMap<dim>::type boundary_condition_function_map;
-        BoundaryValuesForVelocity<dim> velocity_boundary_condition;
-        boundary_condition_function_map[0] = &velocity_boundary_condition;
+        std::set<types::boundary_id> 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);

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.