Skip to content

Commit

Permalink
Merge pull request #16948 from bangerth/boundary-id
Browse files Browse the repository at this point in the history
Make it clearer what an integer argument means.
  • Loading branch information
kronbichler committed May 3, 2024
2 parents 8b80871 + 6180d50 commit 36dc1a7
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion examples/step-3/doc/results.dox
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ suggestions:
call to <code>interpolate_boundary_values</code> for boundary indicator one:
@code
VectorTools::interpolate_boundary_values(dof_handler,
1,
types::boundary_id(1),
Functions::ConstantFunction<2>(1.),
boundary_values);
@endcode
Expand Down
7 changes: 4 additions & 3 deletions examples/step-3/step-3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,9 @@ void Step3::assemble_system()
// boundary by indicators, and tell the interpolate_boundary_values
// function to only compute the boundary values on a certain part of the
// boundary (e.g. the clamped part, or the inflow boundary). By default,
// all boundaries have a 0 boundary indicator, unless otherwise specified. If
// sections of the boundary have different boundary conditions, you have to
// all boundaries have a 0 boundary indicator, unless otherwise specified.
// (For example, many functions in namespace GridGenerator specify otherwise.)
// If sections of the boundary have different boundary conditions, you have to
// number those parts with different boundary indicators. The function call
// below will then only determine boundary values for those parts of the
// boundary for which the boundary indicator is in fact the zero specified as
Expand All @@ -510,7 +511,7 @@ void Step3::assemble_system()
// class.
std::map<types::global_dof_index, double> boundary_values;
VectorTools::interpolate_boundary_values(dof_handler,
0,
types::boundary_id(0),
Functions::ZeroFunction<2>(),
boundary_values);
// Now that we got the list of boundary DoFs and their respective boundary
Expand Down
4 changes: 2 additions & 2 deletions examples/step-4/step-4.cc
Original file line number Diff line number Diff line change
Expand Up @@ -426,12 +426,12 @@ void Step4<dim>::assemble_system()
// on faces that have been marked with boundary indicator 0 (because that's
// what we say the function should work on with the second argument below).
// If there are faces with boundary id other than 0, then the function
// interpolate_boundary_values will do nothing on these faces. For
// interpolate_boundary_values() will do nothing on these faces. For
// the Laplace equation doing nothing is equivalent to assuming that
// on those parts of the boundary a zero Neumann boundary condition holds.
std::map<types::global_dof_index, double> boundary_values;
VectorTools::interpolate_boundary_values(dof_handler,
0,
types::boundary_id(0),
BoundaryValues<dim>(),
boundary_values);
MatrixTools::apply_boundary_values(boundary_values,
Expand Down
2 changes: 1 addition & 1 deletion examples/step-5/step-5.cc
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ void Step5<dim>::assemble_system()
// With the matrix so built, we use zero boundary values again:
std::map<types::global_dof_index, double> boundary_values;
VectorTools::interpolate_boundary_values(dof_handler,
0,
types::boundary_id(0),
Functions::ZeroFunction<dim>(),
boundary_values);
MatrixTools::apply_boundary_values(boundary_values,
Expand Down
2 changes: 1 addition & 1 deletion examples/step-6/step-6.cc
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void Step6<dim>::setup_system()
// order: if two constraints conflict then the constraint matrix either abort
// or throw an exception via the Assert macro.
VectorTools::interpolate_boundary_values(dof_handler,
0,
types::boundary_id(0),
Functions::ZeroFunction<dim>(),
constraints);

Expand Down
2 changes: 1 addition & 1 deletion examples/step-7/step-7.cc
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ namespace Step7

std::map<types::global_dof_index, double> boundary_values;
VectorTools::interpolate_boundary_values(dof_handler,
0,
types::boundary_id(0),
Solution<dim>(),
boundary_values);
MatrixTools::apply_boundary_values(boundary_values,
Expand Down
2 changes: 1 addition & 1 deletion examples/step-8/step-8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ namespace Step8
constraints.clear();
DoFTools::make_hanging_node_constraints(dof_handler, constraints);
VectorTools::interpolate_boundary_values(dof_handler,
0,
types::boundary_id(0),
Functions::ZeroFunction<dim>(dim),
constraints);
constraints.close();
Expand Down

0 comments on commit 36dc1a7

Please sign in to comment.