Code Monkey home page Code Monkey logo

Comments (2)

RemiLehe avatar RemiLehe commented on July 18, 2024

Hi Soeren,

Sorry for my late reply, and thanks for the feedback.

It is true that it would be nice for restart_from_checkpoint to reinitialize a fresh Particle object for every species in the checkpoint openPMD file. However, in practice the openPMD file is missing a few information that are needed to initialize a fresh Particles in a robust manner. For instance, the openPMD file does not tell whether the particles should be continuously injected or not, and if they should, it does not contain the parameters of the injection (density profile, etc.).
For the case of the electron bunch, it would be fine, as this species is not continuously injected and thus (I think) the openPMD file would contain all the information needed for initialization of a new Particles object. However, this would not generalize to other species.

Therefore, for now, I would prefer the solution in which we put add_laser/add_elec_bunch outside of the if block. It is not ideal (e.g. since we are doing extra work to calculate the space-charge field which is then overwritten by restart_from_checkpoint), but at least it is robust.

Does the above make sense, and if yes, would you be willing to do a corresponding pull request?

from fbpic.

soerenjalas avatar soerenjalas commented on July 18, 2024

I see the problem. I've created a pull request with the changes I suggested above. Again as this such a minor issue, if you are not happy with the change feel free to reject the PR.

from fbpic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.