Skip to content
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

Replace stk::mesh::Part* with stk::mesh::PartVector&. Issue #1183 #1185

Merged
merged 2 commits into from
May 9, 2023

Conversation

overfelt
Copy link
Contributor

@overfelt overfelt commented May 9, 2023

PartVectors allow for the specification of a field on a list of parts instead of one part at a time. For some classes it was only possible to pass a single part pointer for the field specification where a part vector would be more flexible.

Started with register_nodal_fields:
from: register_nodal_fields(stk::mesh::Part* part)
to: register_nodal_fields(const stk::mesh::PartVector &part_vec)

The stk::mesh::put_field_on_mesh function does not take a PartVector so create a Selector form a PartVector:
stk::mesh::Selector selector = stk::mesh::selectUnion(part_vec);
and use that instead. There were a couple of places where the construction of a PartVector from a single Part pointer:
PartVector(1,Part*)
was useful.

There were a lot of files changed, but the changes are trivial.

…sue #1183

PartVectors allow for the specification of a field on a list of parts
instead of one part at a time. For some classes it was only possible
to pass a single part pointer for the field specification where a
part vector would be more flexible.

Started with register_nodal_fields:
from: register_nodal_fields(stk::mesh::Part* part)
to:   register_nodal_fields(const stk::mesh::PartVector &part_vec)

The stk::mesh::put_field_on_mesh function does not take a PartVector
so create a Selector form a PartVector:
  stk::mesh::Selector selector = stk::mesh::selectUnion(part_vec);
and use that instead. There were a couple of places where the
construction of a PartVector from a single Part pointer:
   PartVector(1,Part*)
was useful.

There were a lot of files changed, but the changes are trivial.
Copy link
Contributor

@psakievich psakievich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I also see register_interior_algorithm, register_element_field etc still taking Part*. It would be good to convert those too, but I'm fine with a follow on PR's for those if you'd prefer @overfelt.

@@ -102,14 +102,14 @@ get_node_field(
void register_scalar_nodal_field_on_part(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks redundant for what the FieldManager does. These functions look like candidates for the chopping block in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I saw that register_scalar_nodal_field_on_part was only used in a couple of places but was not sure if it was the future or the past. I'll remove it on the next merge request.

Yes, This is just the first of a few merge requests to replace Part* with PartVector. Just wanted to get this in and work on other things for a few days.

@overfelt overfelt merged commit 2a28487 into master May 9, 2023
@overfelt overfelt deleted the jroverf/PartPointer_to_PartVector_Issue_1183 branch May 9, 2023 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants