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,
// 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,
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,
// 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
// 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);