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

Obtain exact time (real) when particles hit boundaries + test #4695

Merged
merged 42 commits into from
Feb 17, 2024

Conversation

EyaDammak
Copy link
Contributor

@EyaDammak EyaDammak commented Feb 13, 2024

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

@EyaDammak EyaDammak changed the title Obtain exact time of Particles with EB in 3D Obtain exact time of Particles with EB + test in 3D Feb 14, 2024
Comment on lines 787 to 788
comp = part_container.comp_names
return comp
Copy link
Contributor Author

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 EyaDammak changed the title Obtain exact time of Particles with EB + test in 3D Obtain exact time when particles hit boundaries + test Feb 15, 2024
@EyaDammak EyaDammak changed the title Obtain exact time when particles hit boundaries + test Obtain exact time (real) when particles hit boundaries + test Feb 15, 2024
auto& warpx = WarpX::GetInstance();
const auto dt = warpx.getdt(pti.GetLevel());
const int step_scraped_index = ptile_buffer.NumRuntimeIntComps()-1;
Copy link
Contributor Author

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');

EyaDammak and others added 3 commits February 16, 2024 13:25
Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
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.

2 participants