void
initialize(const DoFHandler<dim, spacedim> &dof);
- /**
- * Fill the internal data structures with values extracted from the dof
- * handler object and apply the boundary values provided.
- *
- * This function internally calls the initialize() function above and the
- * constrains degrees on the external boundary of the domain by calling
- * MGTools::make_boundary_list() with the given second and third argument.
- *
- * @deprecated Use initialize() followed by make_zero_boundary_constraints() instead
- */
- template <int dim, int spacedim>
- DEAL_II_DEPRECATED void
- initialize(const DoFHandler<dim, spacedim> &dof,
- const std::map<types::boundary_id, const Function<spacedim> *>
- & function_map,
- const ComponentMask &component_mask = ComponentMask());
-
/**
* Fill the internal data structures with information
* about Dirichlet boundary dofs.
}
-template <int dim, int spacedim>
-inline void
-MGConstrainedDoFs::initialize(
- const DoFHandler<dim, spacedim> & dof,
- const std::map<types::boundary_id, const Function<spacedim> *> &function_map,
- const ComponentMask &component_mask)
-{
- initialize(dof);
-
- // allocate an IndexSet for each global level. Contents will be
- // overwritten inside make_boundary_list.
- const unsigned int n_levels = dof.get_triangulation().n_global_levels();
- // At this point boundary_indices is empty.
- boundary_indices.resize(n_levels);
-
- MGTools::make_boundary_list(dof,
- function_map,
- boundary_indices,
- component_mask);
-}
-
template <int dim, int spacedim>
inline void
}
mg_smoother.initialize(mg_matrices, smoother_data);
- MGConstrainedDoFs mg_constrained_dofs;
- Functions::ZeroFunction<dim> zero_function;
- std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
- dirichlet_boundary[0] = &zero_function;
- mg_constrained_dofs.initialize(dof, dirichlet_boundary);
+ MGConstrainedDoFs mg_constrained_dofs;
+ mg_constrained_dofs.initialize(dof);
+ mg_constrained_dofs.make_zero_boundary_constraints(dof, {0});
MGTransferMF<dim, LevelMatrixType> mg_transfer(mg_matrices,
mg_constrained_dofs);
}
mg_smoother.initialize(mg_matrices, smoother_data);
- MGConstrainedDoFs mg_constrained_dofs;
- Functions::ZeroFunction<dim> zero_function;
- std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
- dirichlet_boundary[0] = &zero_function;
- mg_constrained_dofs.initialize(dof, dirichlet_boundary);
+ MGConstrainedDoFs mg_constrained_dofs;
+ mg_constrained_dofs.initialize(dof);
+ mg_constrained_dofs.make_zero_boundary_constraints(dof, {0});
MGTransferMF<dim, LevelMatrixType> mg_transfer(mg_matrices,
mg_constrained_dofs);
// level constraints:
MGConstrainedDoFs mg_constrained_dofs;
- mg_constrained_dofs.initialize(dof, dirichlet_boundary);
+ mg_constrained_dofs.initialize(dof);
+ mg_constrained_dofs.make_zero_boundary_constraints(dof, {0});
MappingQ<dim> mapping(fe_degree + 1);
Functions::ZeroFunction<dim> zero_function;
std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
dirichlet_boundary[0] = &zero_function;
- mg_constrained_dofs.initialize(dof, dirichlet_boundary);
+ mg_constrained_dofs.initialize(dof);
+ mg_constrained_dofs.make_zero_boundary_constraints(dof, {0});
MappingQ<dim> mapping(fe_degree + 1);
LaplaceOperator<dim, fe_degree, n_q_points_1d, number> fine_matrix;
// level constraints:
MGConstrainedDoFs mg_constrained_dofs;
- mg_constrained_dofs.initialize(dof, dirichlet_boundary);
+ mg_constrained_dofs.initialize(dof);
+ mg_constrained_dofs.make_zero_boundary_constraints(dof, {0});
MappingQ<dim> mapping(fe_degree + 1);
Functions::ZeroFunction<dim> zero_function;
std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
dirichlet_boundary[0] = &zero_function;
- mg_constrained_dofs.initialize(dof, dirichlet_boundary);
+ mg_constrained_dofs.initialize(dof);
+ mg_constrained_dofs.make_zero_boundary_constraints(dof, {0});
MappingQ<dim> mapping(fe_degree + 1);
LaplaceOperator<dim, fe_degree, n_q_points_1d, double> fine_matrix;
// level constraints:
MGConstrainedDoFs mg_constrained_dofs;
- mg_constrained_dofs.initialize(dof, dirichlet_boundary);
+ mg_constrained_dofs.initialize(dof);
+ mg_constrained_dofs.make_zero_boundary_constraints(dof, {0});
MappingQ<dim> mapping(fe_degree + 1);
Functions::ZeroFunction<dim> zero_function;
std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
dirichlet_boundary[0] = &zero_function;
- mg_constrained_dofs.initialize(dof, dirichlet_boundary);
+ mg_constrained_dofs.initialize(dof);
+ mg_constrained_dofs.make_zero_boundary_constraints(dof, {0});
MappingQ<dim> mapping(fe_degree + 1);
LaplaceOperator<dim, fe_degree, n_q_points_1d, double> fine_matrix;
// level constraints:
MGConstrainedDoFs mg_constrained_dofs;
- mg_constrained_dofs.initialize(dof, dirichlet_boundary);
+ mg_constrained_dofs.initialize(dof);
+ mg_constrained_dofs.make_zero_boundary_constraints(dof, {0});
MappingQ<dim> mapping(fe_degree + 1);
// level constraints:
MGConstrainedDoFs mg_constrained_dofs;
- mg_constrained_dofs.initialize(dof, dirichlet_boundary);
+ mg_constrained_dofs.initialize(dof);
+ mg_constrained_dofs.make_zero_boundary_constraints(dof, {0});
MappingQ<dim> mapping(fe_degree + 1);
// level constraints:
std::vector<MGConstrainedDoFs> mg_constrained_dofs(dof.size());
for (unsigned int i = 0; i < dof.size(); ++i)
- mg_constrained_dofs[i].initialize(*dof[i], dirichlet_boundary);
+ {
+ mg_constrained_dofs[i].initialize(*dof[i]);
+ mg_constrained_dofs[i].make_zero_boundary_constraints(*dof[i], {0});
+ }
// set up multigrid in analogy to step-37
typedef BlockLaplace<dim,
// level constraints:
MGConstrainedDoFs mg_constrained_dofs;
- mg_constrained_dofs.initialize(dof, dirichlet_boundary);
+ mg_constrained_dofs.initialize(dof);
+ mg_constrained_dofs.make_zero_boundary_constraints(dof, {0});
MappingQ<dim> mapping(fe_degree + 1);
mg_matrices[level].initialize(mapping, dof, dirichlet_boundaries, level);
}
- MGConstrainedDoFs mg_constrained_dofs;
- Functions::ZeroFunction<dim> zero_function;
- std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
- dirichlet_boundary[0] = &zero_function;
- mg_constrained_dofs.initialize(dof, dirichlet_boundary);
+ MGConstrainedDoFs mg_constrained_dofs;
+ mg_constrained_dofs.initialize(dof);
+ mg_constrained_dofs.make_zero_boundary_constraints(dof, {0});
MGTransferPrebuiltMF<dim, LevelMatrixType> mg_transfer(mg_matrices,
mg_constrained_dofs);
mg_matrices[level].initialize(mapping, dof, dirichlet_boundaries, level);
}
- MGConstrainedDoFs mg_constrained_dofs;
- Functions::ZeroFunction<dim> zero_function;
- std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
- dirichlet_boundary[0] = &zero_function;
- mg_constrained_dofs.initialize(dof, dirichlet_boundary);
+ MGConstrainedDoFs mg_constrained_dofs;
+ mg_constrained_dofs.initialize(dof);
+ mg_constrained_dofs.make_zero_boundary_constraints(dof, {0});
MGTransferPrebuiltMF<dim, LevelMatrixType> mg_transfer(mg_matrices,
mg_constrained_dofs);
// set up multigrid in analogy to step-37
MGConstrainedDoFs mg_constrained_dofs;
- mg_constrained_dofs.initialize(dof, dirichlet_boundary);
+ mg_constrained_dofs.initialize(dof);
+ mg_constrained_dofs.make_zero_boundary_constraints(dof, {0});
typedef MatrixFreeOperators::LaplaceOperator<
dim,
true);
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, {0});
const unsigned int n_levels = triangulation.n_global_levels();
true);
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, {0});
const unsigned int n_levels = triangulation.n_global_levels();
cell->update_cell_dof_indices_cache();
}
- std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
- Functions::ZeroFunction<dim> homogeneous_dirichlet_bc(1);
- dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
- mg_constrained_dofs_ref.initialize(dofhref, dirichlet_boundary);
+ mg_constrained_dofs_ref.initialize(dofhref);
+ mg_constrained_dofs_ref.make_zero_boundary_constraints(dofhref, {0});
}
MGConstrainedDoFs mg_constrained_dofs;
- std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
- Functions::ZeroFunction<dim> homogeneous_dirichlet_bc(1);
- dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
- mg_constrained_dofs.initialize(dofh, dirichlet_boundary);
+ mg_constrained_dofs.initialize(dofh);
+ mg_constrained_dofs.make_zero_boundary_constraints(dofh, {0});
const unsigned int n_levels = tr.n_global_levels();
for (unsigned int level = 0; level < n_levels; ++level)
cell->update_cell_dof_indices_cache();
}
- std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
- Functions::ZeroFunction<dim> homogeneous_dirichlet_bc(1);
- dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
- mg_constrained_dofs_ref.initialize(dofhref, dirichlet_boundary);
+ mg_constrained_dofs_ref.initialize(dofhref);
+ mg_constrained_dofs_ref.make_zero_boundary_constraints(dofhref, {0});
}
MGConstrainedDoFs mg_constrained_dofs;
-
- std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
- Functions::ZeroFunction<dim> homogeneous_dirichlet_bc(1);
- dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
- mg_constrained_dofs.initialize(dofh, dirichlet_boundary);
+ mg_constrained_dofs.initialize(dofh);
+ mg_constrained_dofs.make_zero_boundary_constraints(dofh, {0});
const unsigned int n_levels = tr.n_global_levels();
for (unsigned int level = 0; level < n_levels; ++level)
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, {0});
const unsigned int n_levels = triangulation.n_global_levels();
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, {0});
const unsigned int n_levels = triangulation.n_global_levels();
Triangulation<dim> tr(Triangulation<dim>::limit_level_difference_at_vertices);
GridGenerator::hyper_cube(tr, -1, 1);
- std::map<types::boundary_id, const Function<dim> *>
- dirichlet_boundary_functions;
- Functions::ZeroFunction<dim> homogeneous_dirichlet_bc(1);
- dirichlet_boundary_functions[0] = &homogeneous_dirichlet_bc;
tr.refine_global(1);
refine_mesh(tr);
DoFRenumbering::component_wise(mgdof_renumbered, level, block_component);
MGConstrainedDoFs mg_constrained_dofs;
- mg_constrained_dofs.initialize(mgdof, dirichlet_boundary_functions);
+ mg_constrained_dofs.initialize(mgdof);
+ mg_constrained_dofs.make_zero_boundary_constraints(mgdof, {0});
MGConstrainedDoFs mg_constrained_dofs_renumbered;
- mg_constrained_dofs_renumbered.initialize(mgdof_renumbered,
- dirichlet_boundary_functions);
+ mg_constrained_dofs_renumbered.initialize(mgdof_renumbered);
+ mg_constrained_dofs_renumbered.make_zero_boundary_constraints(
+ mgdof_renumbered, {0});
MGTransferPrebuilt<Vector<double>> transfer(mg_constrained_dofs);
transfer.build(mgdof);
Triangulation<dim> tr(Triangulation<dim>::limit_level_difference_at_vertices);
GridGenerator::hyper_cube(tr, -1, 1);
- std::map<types::boundary_id, const Function<dim> *>
- dirichlet_boundary_functions;
tr.refine_global(1);
refine_mesh(tr);
DoFRenumbering::component_wise(mgdof_renumbered, level, block_component);
MGConstrainedDoFs mg_constrained_dofs;
- mg_constrained_dofs.initialize(mgdof, dirichlet_boundary_functions);
+ mg_constrained_dofs.initialize(mgdof);
MGConstrainedDoFs mg_constrained_dofs_renumbered;
- mg_constrained_dofs_renumbered.initialize(mgdof_renumbered,
- dirichlet_boundary_functions);
+ mg_constrained_dofs_renumbered.initialize(mgdof_renumbered);
MGTransferPrebuilt<Vector<double>> transfer(mg_constrained_dofs);
transfer.build(mgdof);
void
LaplaceProblem<dim>::test()
{
- std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
- Functions::ZeroFunction<dim> dirichlet_bc(fe.n_components());
- dirichlet_boundary[0] = &dirichlet_bc;
-
const unsigned int min_l = mg_matrices.min_level();
const unsigned int max_l = mg_matrices.max_level();
for (unsigned int l = min_l; l < max_l; ++l)
}
MGConstrainedDoFs mg_constrained_dofs;
- 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, {0});
MGConstrainedDoFs mg_constrained_dofs_renumbered;
- mg_constrained_dofs_renumbered.initialize(mg_dof_handler_renumbered,
- dirichlet_boundary);
+ mg_constrained_dofs_renumbered.initialize(mg_dof_handler_renumbered);
+ mg_constrained_dofs_renumbered.make_zero_boundary_constraints(
+ mg_dof_handler_renumbered, {0});
MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
mg_transfer.build(mg_dof_handler);
void
LaplaceProblem<dim>::test()
{
- std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
- Functions::ZeroFunction<dim> dirichlet_bc(fe.n_components());
- dirichlet_boundary[0] = &dirichlet_bc;
-
MGConstrainedDoFs mg_constrained_dofs;
- 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, {0});
MGConstrainedDoFs mg_constrained_dofs_renumbered;
- mg_constrained_dofs_renumbered.initialize(mg_dof_handler_renumbered,
- dirichlet_boundary);
+ mg_constrained_dofs_renumbered.initialize(mg_dof_handler_renumbered);
+ mg_constrained_dofs_renumbered.make_zero_boundary_constraints(
+ mg_dof_handler_renumbered, {0});
MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
mg_transfer.build(mg_dof_handler);
system_matrix.reinit(sparsity_pattern);
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, {0});
const unsigned int n_levels = triangulation.n_levels();
mg_interface_in.resize(0, n_levels - 1);
system_matrix.reinit(sparsity_pattern);
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, {0});
const unsigned int n_levels = triangulation.n_levels();
mg_interface_matrices.resize(min_level, n_levels - 1);
system_matrix.reinit(sparsity_pattern);
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, {0});
const unsigned int n_levels = triangulation.n_levels();
mg_interface_matrices.resize(min_level, n_levels - 1);
system_matrix.reinit(sparsity_pattern);
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, {0});
const unsigned int n_levels = triangulation.n_levels();
mg_interface_matrices.resize(min_level, n_levels - 1);
system_matrix.reinit(sparsity_pattern);
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, {0});
const unsigned int n_levels = triangulation.n_levels();
mg_interface_matrices.resize(min_level, n_levels - 1);
system_matrix.reinit(sparsity_pattern);
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, {0});
const unsigned int n_levels = triangulation.n_levels();
mg_interface_matrices.resize(0, n_levels - 1);
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, {0});
const unsigned int n_levels = triangulation.n_global_levels();
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, {0});
const unsigned int n_levels = triangulation.n_global_levels();
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, {0});
const unsigned int n_levels = triangulation.n_global_levels();
system_matrix.reinit(sparsity_pattern);
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, {0});
const unsigned int n_levels = triangulation.n_levels();
mg_interface_matrices.resize(0, n_levels - 1);
system_matrix.reinit(sparsity_pattern);
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, {0});
const unsigned int n_levels = triangulation.n_levels();
mg_interface_in.resize(0, n_levels - 1);
system_matrix.reinit(sparsity_pattern);
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, {0});
const unsigned int n_levels = triangulation.n_levels();
mg_interface_matrices.resize(0, n_levels - 1);
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, {0});
const unsigned int n_levels = triangulation.n_global_levels();
mgdof.distribute_dofs(fe);
mgdof.distribute_mg_dofs();
- MGConstrainedDoFs mg_constrained_dofs;
- Functions::ZeroFunction<dim> zero_function;
- std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
- dirichlet_boundary[0] = &zero_function;
- mg_constrained_dofs.initialize(mgdof, dirichlet_boundary);
+ MGConstrainedDoFs mg_constrained_dofs;
+ mg_constrained_dofs.initialize(mgdof);
+ mg_constrained_dofs.make_zero_boundary_constraints(mgdof, {0});
// build reference non-block
MGTransferMatrixFree<dim, Number> transfer_ref(mg_constrained_dofs);
const std::vector<const DoFHandler<dim> *> mgdof_ptr{&mgdof_1, &mgdof_2};
std::vector<MGConstrainedDoFs> mg_constrained_dofs_vector(2);
- Functions::ZeroFunction<dim> zero_function;
- std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
- dirichlet_boundary[0] = &zero_function;
for (unsigned int i = 0; i < mgdof_ptr.size(); ++i)
- mg_constrained_dofs_vector[i].initialize(*mgdof_ptr[i],
- dirichlet_boundary);
+ {
+ mg_constrained_dofs_vector[i].initialize(*mgdof_ptr[i]);
+ mg_constrained_dofs_vector[i].make_zero_boundary_constraints(
+ *mgdof_ptr[i], {0});
+ }
// build reference non-block
std::vector<MGTransferMatrixFree<dim, Number>> transfer_ref;
mgdof.distribute_dofs(fe);
mgdof.distribute_mg_dofs();
- MGConstrainedDoFs mg_constrained_dofs;
- Functions::ZeroFunction<dim> zero_function;
- std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
- dirichlet_boundary[0] = &zero_function;
- mg_constrained_dofs.initialize(mgdof, dirichlet_boundary);
+ MGConstrainedDoFs mg_constrained_dofs;
+ mg_constrained_dofs.initialize(mgdof);
+ mg_constrained_dofs.make_zero_boundary_constraints(mgdof, {0});
// build reference
MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>>
mgdof.distribute_dofs(fe);
mgdof.distribute_mg_dofs();
- MGConstrainedDoFs mg_constrained_dofs;
- Functions::ZeroFunction<dim> zero_function;
- std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
- dirichlet_boundary[0] = &zero_function;
- mg_constrained_dofs.initialize(mgdof, dirichlet_boundary);
+ MGConstrainedDoFs mg_constrained_dofs;
+ mg_constrained_dofs.initialize(mgdof);
+ mg_constrained_dofs.make_zero_boundary_constraints(mgdof, {0});
// build reference
MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>>
mgdof.distribute_dofs(fe);
mgdof.distribute_mg_dofs();
- MGConstrainedDoFs mg_constrained_dofs;
- Functions::ZeroFunction<dim> zero_function;
- std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
- dirichlet_boundary[0] = &zero_function;
- mg_constrained_dofs.initialize(mgdof, dirichlet_boundary);
+ MGConstrainedDoFs mg_constrained_dofs;
+ mg_constrained_dofs.initialize(mgdof);
+ mg_constrained_dofs.make_zero_boundary_constraints(mgdof, {0});
// build reference
MGTransferMatrixFree<dim, Number> transfer_ref(mg_constrained_dofs);
const std::vector<const DoFHandler<dim> *> mgdof_ptr{&mgdof_1, &mgdof_2};
std::vector<MGConstrainedDoFs> mg_constrained_dofs_vector(2);
- Functions::ZeroFunction<dim> zero_function;
- std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
- dirichlet_boundary[0] = &zero_function;
for (unsigned int i = 0; i < mgdof_ptr.size(); ++i)
- mg_constrained_dofs_vector[i].initialize(*mgdof_ptr[i],
- dirichlet_boundary);
+ {
+ mg_constrained_dofs_vector[i].initialize(*mgdof_ptr[i]);
+ mg_constrained_dofs_vector[i].make_zero_boundary_constraints(
+ *mgdof_ptr[i], {0});
+ }
// build reference
std::vector<MGTransferMatrixFree<dim, Number>> transfer_ref;
mgdof.distribute_dofs(fe);
mgdof.distribute_mg_dofs();
- MGConstrainedDoFs mg_constrained_dofs;
- Functions::ZeroFunction<dim> zero_function;
- std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
- dirichlet_boundary[0] = &zero_function;
- mg_constrained_dofs.initialize(mgdof, dirichlet_boundary);
+ MGConstrainedDoFs mg_constrained_dofs;
+ mg_constrained_dofs.initialize(mgdof);
+ mg_constrained_dofs.make_zero_boundary_constraints(mgdof, {0});
// build reference
MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>>
mgdof.distribute_dofs(fe);
mgdof.distribute_mg_dofs();
- MGConstrainedDoFs mg_constrained_dofs;
- Functions::ZeroFunction<dim> zero_function;
- std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
- dirichlet_boundary[0] = &zero_function;
- mg_constrained_dofs.initialize(mgdof, dirichlet_boundary);
+ MGConstrainedDoFs mg_constrained_dofs;
+ mg_constrained_dofs.initialize(mgdof);
+ mg_constrained_dofs.make_zero_boundary_constraints(mgdof, {0});
// build reference
MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>>
mgdof.distribute_dofs(fe);
mgdof.distribute_mg_dofs();
- std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
- Functions::ZeroFunction<dim> homogeneous_dirichlet_bc(1);
- dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
-
MGConstrainedDoFs mg_constrained_dofs;
- mg_constrained_dofs.initialize(mgdof, dirichlet_boundary);
+ mg_constrained_dofs.initialize(mgdof);
+ mg_constrained_dofs.make_zero_boundary_constraints(mgdof, {0});
MGTransferPrebuilt<Vector<double>> transfer(mg_constrained_dofs);
transfer.build(mgdof);
mgdof.distribute_dofs(fe);
mgdof.distribute_mg_dofs();
- MGConstrainedDoFs mg_constrained_dofs;
- Functions::ZeroFunction<dim> zero_function;
- std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
- dirichlet_boundary[0] = &zero_function;
- mg_constrained_dofs.initialize(mgdof, dirichlet_boundary);
+ MGConstrainedDoFs mg_constrained_dofs;
+ mg_constrained_dofs.initialize(mgdof);
+ mg_constrained_dofs.make_zero_boundary_constraints(mgdof, {0});
unsigned int myid = Utilities::MPI::this_mpi_process(MPI_COMM_WORLD);
for (unsigned int level = 0; level < tr.n_levels(); ++level)
DoFRenumbering::component_wise(mg_dof_handler, level);
- std::vector<std::set<unsigned int>> boundary_indices(tr.n_levels());
- std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
- Functions::ZeroFunction<dim> dirichlet_bc(fe.n_components());
- dirichlet_boundary[3] = &dirichlet_bc;
-
MGConstrainedDoFs mg_constrained_dofs;
- 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, {3});
MGTransferPrebuilt<Vector<double>> transfer(mg_constrained_dofs);
transfer.build(mg_dof_handler);