I somehow didn't come up intuitively with the idea of taking a closer look at the fe.component_mask parameter. I believe it would be helpful to have an extension with an example in some of the tutorial steps.
Like in step-20 or so:
Depending on the type of the prescribed Dirichlet boundary conditions the VectorTools::interpolate_boundary_values() class can be used to interpolate boundary conditions as well on single boundary degrees of freedom. The fe.component_mask inside VectorTools::interpolate_boundary_values() specifies the desired components for selection.
For instance, we want to set only x and y displacement components on the boundary with the id=3 to a certain value, according to the BoundaryValue<dim>() function, then the VectorTools::interpolate_boundary_values() class can be modified in the following manner:
DoFTools::make_hanging_node_constraints(dof_handler, constraints);
std::vector<bool> choice={true,true,false,false};
VectorTools::interpolate_boundary_values(dof_handler,
3,
BoundaryValue<dim>(),
constraints,
fe.component_mask(choice));
With kind regards,
Mariia
среда, 3 ноября 2021 г. в 20:34:02 UTC+1, Wolfgang Bangerth: