ippl icon indicating copy to clipboard operation
ippl copied to clipboard

Changing Template variable in PicManager

Open JoMee opened this issue 1 year ago • 2 comments

I changed the template variable of the field solver class to be more generic. One needs this to for example run multiple solvers in one step. I don't see a reason why this is not generic, I also updated the alpine manager and the simulations ran without problem.

JoMee avatar May 01 '24 17:05 JoMee

I could be wrong, but if the pointer type is going to be a template parameter why would we not remove the polymorphism altogether? Going from std::shared_ptr<solver_base> to simply a solver_type?

manuel5975p avatar May 05 '24 17:05 manuel5975p

That depends if we want to support switching out the solver at runtime in the future (as we currently do with the FieldContainer or ParticleContainer). I don't think the overhead of this attribute is going to be too large. Another point is if we want to return a pointer to the field solver at some point then it would be correct to have it as a shared pointer. (Since if the PICManager is destructed, the field solver would also get destructed)

In summary, it is probably the more future-proof way and doesn't add significant overhead, this is why I would keep it in a shared_ptr.

JoMee avatar Mar 18 '25 15:03 JoMee