-
Notifications
You must be signed in to change notification settings - Fork 200
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
Obtain exact time (real) when particles hit boundaries + test #4695
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
EyaDammak
commented
Feb 15, 2024
Comment on lines
787
to
788
comp = part_container.comp_names | ||
return comp |
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.
Suggested change
comp = part_container.comp_names | |
return comp | |
data_array = [] | |
if comp_name in part_container.real_comp_names: | |
comp_idx = part_container.real_comp_names[com_name] | |
... loop over tiles and append to `data_array`, calling `get_real_data` | |
elif comp_name in part_container.int_comp_names: | |
comp_idx = part_container.int_comp_names[com_name] | |
... same thing but with `get_real_data` | |
else: | |
raise RuntimeError('Name %s not found' %comp_name) | |
return data_array |
EyaDammak
commented
Feb 16, 2024
auto& warpx = WarpX::GetInstance(); | ||
const auto dt = warpx.getdt(pti.GetLevel()); | ||
const int step_scraped_index = ptile_buffer.NumRuntimeIntComps()-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.
auto string_to_index_intcomp = buffer[i].getParticleiComps();
int step_scraped_index = string_to_index_intcomp.at('step_scraped');
auto string_to_index_realcomp = buffer[i].getParticleComps();
int time_scraped_index = string_to_index_realcomp.at('time_scraped');
RemiLehe
reviewed
Feb 16, 2024
RemiLehe
reviewed
Feb 16, 2024
Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
RemiLehe
approved these changes
Feb 17, 2024
This was referenced Feb 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is adding a new real attribute for the time called "time_scraped" in the buffer of the particles absorbed in the boundaries. This new attribute calculates the real time when the particle hits the embedded boundary at the exact point of contact.
The PIC iteration at which each particle was absorbed at the boundary remains saved as an integer but it is called now "step_scraped" rather than "timestamp".
Note 1: Note that the attributes are accessed in the Python function ts.get_particle() respectively by 'timeScraped' and 'stepScraped'. For the Python function buffer.get_particle_boundary_buffer(), the names remain 'time_scraped' and 'step_scraped'
Note 2: We changed how to read in the dictionary in the file Source/Python/Particles/PinnedMemoryParticleContainer.cpp
Note 3: It still needs to calculate the exact point of contact + exact time for the regular boundaries. The real time added for the regular boundaries is temporary