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

[WIP] Split Particle Container Init Logic #5015

Open
wants to merge 8 commits into
base: development
Choose a base branch
from

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Jun 24, 2024

Currently, the particle init is done very early in WarpX, which complicates new logic for when we want to query large, distributed fields to initialize particles from field values (external files of density and temperature maps, etc.).

This PR minimizes the logic done in the particle container constructor. We now init data explicitly in InitData() calls. This makes it easier to create particle container variables and meshes and then initialize particles based on initialized meshes at a later point in the logic.

Isolated from #4754 for separate testing & merging.

@ax3l ax3l added the cleaning Clean code, improve readability label Jun 24, 2024
@ax3l ax3l requested review from RemiLehe and atmyers June 24, 2024 22:24
@ax3l ax3l requested a review from EZoni July 19, 2024 18:08
@ax3l
Copy link
Member Author

ax3l commented Jul 19, 2024

I am back from vacation working on this again now.

@ax3l ax3l force-pushed the topic-pc-init-fields branch 3 times, most recently from d9fd104 to dc71c1c Compare July 19, 2024 22:03
@ax3l ax3l force-pushed the topic-pc-init-fields branch 3 times, most recently from ba678b7 to 5a6070e Compare August 16, 2024 20:38
@ax3l ax3l changed the title PC: Do Less in Constructor [WIP] PC: Do Less in Constructor Aug 16, 2024
@ax3l ax3l force-pushed the topic-pc-init-fields branch from 5a6070e to ad89dc8 Compare August 28, 2024 23:13
@ax3l ax3l force-pushed the topic-pc-init-fields branch from ad89dc8 to 54100a3 Compare January 3, 2025 00:46
@ax3l
Copy link
Member Author

ax3l commented Jan 3, 2025

Back from parental leave (part 1) and working on this again.

@ax3l ax3l force-pushed the topic-pc-init-fields branch from 54100a3 to 2ea9c80 Compare January 3, 2025 19:37
@ax3l ax3l changed the title [WIP] PC: Do Less in Constructor [WIP] Split Particle Container Init Logic Jan 6, 2025
ax3l added 3 commits January 10, 2025 09:41
Minimize the logic done in the particle container constructor. Init
data in `InitData()`.

This is needed to have access to field data during particle init,
e.g., to load particles from density files.
- special treatment of `pc_tmp`
- `ispecies` is unused
QED logic init requires initialized particle species.
ax3l added 4 commits January 10, 2025 14:03
In IDEs, we want to attach debuggers to CTest runs. This needs
an option to disable signal handling from AMReX to work.
@ax3l ax3l force-pushed the topic-pc-init-fields branch from 07d6878 to cfc39f4 Compare January 10, 2025 22:06
@@ -19,6 +19,7 @@
h_policies.resize(names.size());
for (const auto& kv : names)
{
//amrex::Print() << "getPolicies: " << kv.first << " " << kv.second << std::endl;

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
@ax3l ax3l force-pushed the topic-pc-init-fields branch from 76deb19 to 2f18c0a Compare January 12, 2025 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleaning Clean code, improve readability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants