Skip to content

SmartCopy: Custom Default Initialization #3690

Open
@ax3l

Description

@ax3l

Problem Description

For scenarios such as HEP LWFA/PWFA ionization injection (and any injection that is non-external), QED beam collisions & radiation generation, etc. we often need to know where newly generated particles originated.

Generally, we add a runtime attribute orig_x/y/z to particles that stores position_x/y/z at t=0 of the simulation. When generating electrons and photons during the simulation (t>0) with ionization & qed, we cannot yet store their position at generation.

What Needs to be Done First

We need to implement a more general version of SmartCopy, which is used in ionization and QED physics.

  • Smart Copy copies matching attributes, and default-initializes all other attributes in the destination particle.
  • We would need a policy (runtime or compile-time) that allows us to do custom initialization in the destination particle.
  • In particular, we need a method to init the dest runtime attributes orig_x/y/z with src position_x/y/z on particle creation.

Files that implement these routines:

What Will be Follow-Up Tasks

  • Update ionization and QED generation logic to support this.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions