-
Notifications
You must be signed in to change notification settings - Fork 23
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
openPMD Beam Input via Source
Element
#820
Conversation
01ccc1e
to
160e870
Compare
160e870
to
5134da6
Compare
Ok I got all functionality implemented, but will pick another example. The FODO channel demos another use case with the skipping of beam monitor outputs, which becomes to overloaded and involved to base the restart demo on... Update: done. |
2c731fc
to
f87f83f
Compare
print(f" rtol={rtol} (ignored: atol~={atol})") | ||
|
||
assert np.allclose( | ||
[sigx, sigy, emittance_x, emittance_y, emittance_t], |
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.
I skipped the sigt
comparison here because I did not know the final value after a total of 4 solenoids and there seems to be some dispersion.
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.
From Slack:
Here
sigma_t
should evolve just as it would in a drift space. It is not matched, since there is no longitudinal focusing. So it should be ignored if you’re looking at how well the initial and final distributions agree.
487662d
to
1f763ad
Compare
1f763ad
to
d2d99fe
Compare
d2d99fe
to
f03a11e
Compare
/* | ||
using SrcData = WarpXParticleContainer::ParticleTileType::ConstParticleTileDataType; | ||
tmp.copyParticles(*pc, | ||
[=] AMREX_GPU_HOST_DEVICE (const SrcData& src, int ip, const amrex::RandomEngine& engine) | ||
{ | ||
const SuperParticleType& p = src.getSuperParticle(ip); | ||
return random_filter(p, engine) * uniform_filter(p, engine) | ||
* parser_filter(p, engine) * geometry_filter(p, engine); | ||
}, true); | ||
*/ |
Check notice
Code scanning / CodeQL
Commented-out code Note
/* | ||
// comment this in once IntSoA::nattribs is > 0 | ||
|
||
std::copy(IntSoA::names_s.begin(), IntSoA::names_s.end(), int_soa_names.begin()); | ||
|
||
for (auto int_idx=0; int_idx < RealSoA::nattribs; int_idx++) { | ||
auto const component_name = int_soa_names.at(int_idx); | ||
getComponentRecord(component_name).storeChunkRaw( | ||
soa.GetIntData(int_idx).data(), {offset}, {numParticleOnTile64}); | ||
} | ||
*/ |
Check notice
Code scanning / CodeQL
Commented-out code Note
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.
The logic looks good to me. The app benchmark works for me. However, I was unable to run the Python test successfully. We might need to check the updates to elements.cpp
.
What kind of error did you get in the Python example? Did you try via ctest --test-dir build --output-on-failure -R solenoid ? |
|
The problem does not occur using |
Ah perfect, the error just says it cannot find the file to load under the provided path:
Instead of using I think what happened is that you ran the app version of the regular solenoid example, then the two restart files. That works, but you need to replace |
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.
Looks good.
Add a new element
Source
that reads openPMD files from our beam monitors. Add an example in Python. Close #97This can also be used to restart a simulation that was checkpointed at a beam monitor.
Follow-Up Ideas
This is designed intentionally as a new element. In the future, we probably restructure our initial distribution logic to also go into this element, so that "from file" is just one of its options.
Not needed for Sirepo, but we will also add an option to use this from inputs files: