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

Enable user boundary conditions for particles #655

Merged
merged 17 commits into from
Apr 20, 2022

Conversation

brryan
Copy link
Collaborator

@brryan brryan commented Mar 2, 2022

PR Summary

Particle swarms are intended to support user-provided boundary conditions, but there was a bit of connectivity missing between the user-side application inputs and the Swarms themselves; specifically, we were checking for correct particle boundaries before user boundaries could be set.

On an earlier attempt at making this change I noticed that InitUserMeshData is (I think) not very useful right now because application-specified functions can't access the Mesh variables. In particular, I need to be able to set Swarm boundary conditions to application-specific user values at this point in the mesh setup. I don't use InitUserMeshData here but I assume we want this change?

All this PR does is add the this pointer to the Mesh calls to InitUserMeshData.

PR Checklist

  • Code passes cpplint
  • New features are documented.
  • Adds a test for any bugs fixed. Adds tests for new features.
  • Code is formatted
  • Changes are summarized in CHANGELOG.md
  • CI has been triggered on Darwin for performance regression tests.
  • (@lanl.gov employees) Update copyright on changed files

@brryan brryan self-assigned this Mar 2, 2022
@brryan brryan changed the title Add Mesh pointer to InitUserMeshData Enable user boundary conditions for particles Mar 2, 2022
@brryan brryan changed the title Enable user boundary conditions for particles WIP: Enable user boundary conditions for particles Mar 2, 2022
@brryan brryan changed the title WIP: Enable user boundary conditions for particles Enable user boundary conditions for particles Mar 3, 2022
Copy link
Collaborator

@Yurlungur Yurlungur left a comment

Choose a reason for hiding this comment

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

A few minor documentation nitpicks. Otherwise looks good.

Copy link
Collaborator

@lroberts36 lroberts36 left a comment

Choose a reason for hiding this comment

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

LGTM. None of my comments are blocking.

Comment on lines +601 to +604
if (start_index < 0) {
start_index = -1;
break;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are these changes related to setting the user boundary conditions or is this a separate fix?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a separate fix that came up while I was testing this PR -- for some pools of particles (in particular when using very few particles) one could end up trying to index into an array with start_index where start_index was -1 which would segfault.

Copy link
Collaborator

@pgrete pgrete left a comment

Choose a reason for hiding this comment

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

In addition to the comments I left, how about modifying/adding a test case where this infrastructure is called?

@brryan
Copy link
Collaborator Author

brryan commented Apr 4, 2022

In addition to the comments I left, how about modifying/adding a test case where this infrastructure is called?

@pgrete I added an AllocateBoundaries call to the Swarm that includes a custom IX1 boundary

Copy link
Collaborator

@pgrete pgrete left a comment

Choose a reason for hiding this comment

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

Thanks for the updates.
I'm already approving pending the potential changes pertaining to the boundary allocation.

@Yurlungur Yurlungur enabled auto-merge April 20, 2022 16:41
@Yurlungur Yurlungur merged commit a4d490a into develop Apr 20, 2022
@pgrete pgrete deleted the brryan/extend_init_user_mesh_data branch May 17, 2022 10:19
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.

4 participants