New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use simpler initialization of std::set #13676
Conversation
@@ -172,8 +172,7 @@ test() | |||
stokes_sub_blocks[dim] = 1; | |||
DoFRenumbering::component_wise(dof_handler, stokes_sub_blocks); | |||
|
|||
std::set<types::boundary_id> no_normal_flux_boundaries; | |||
no_normal_flux_boundaries.insert(1); | |||
std::set<types::boundary_id> no_normal_flux_boundaries = {1}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::set<types::boundary_id> no_normal_flux_boundaries = {1}; | |
const std::set<types::boundary_id> no_normal_flux_boundaries = {1}; |
I think const
should work here, too.
It's just a test. I don't insist on this change :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. I widened my search and found some more appearances.
Another id will be added after you initialize the container as |
examples/step-37/step-37.cc
Outdated
@@ -841,8 +841,7 @@ namespace Step37 | |||
const unsigned int nlevels = triangulation.n_global_levels(); | |||
mg_matrices.resize(0, nlevels - 1); | |||
|
|||
std::set<types::boundary_id> dirichlet_boundary; | |||
dirichlet_boundary.insert(0); | |||
const std::set<types::boundary_id> dirichlet_boundary = {0}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you're already in this patch, would you mind terribly changing the name for the variable to dirichlet_boundary_ids
? Because it's really a set of ids, not of boundaries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not at all - I fixed this here and in step-66.
94eaf43
to
33efc28
Compare
@marcfehling I fixed this problem - and I also updated the test, because it did not actually use that function with the particular boundary id as it was supposed to be from the test description. Now it should be fine. |
33efc28
to
96bc741
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI is happy. Ready to merge.
@@ -44,7 +43,7 @@ check_this(const DoFHandler<dim> &dof_handler) | |||
|
|||
// check for boundary id 0 and 1 | |||
boundary_ids.insert(1); | |||
DoFTools::map_dof_to_boundary_indices(dof_handler, map); | |||
DoFTools::map_dof_to_boundary_indices(dof_handler, boundary_ids, map); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! :)
As suggested by #13674 (comment) - thanks @bangerth for the good hint for modernizing things.