Skip to content

How to init the added new comp of particles? #5098

Closed Answered by roelof-groenewald
zhazhajust asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @zhazhajust. I'm assuming you are using Python since you asked about getting the pointer to the added real component.

The test at https://github.com/ECP-WarpX/WarpX/blob/development/Examples/Physics_applications/laser_ion/PICMI_inputs_2d.py shows how to set new real attributes with a given initialization function (which will be evaluated at the time of creation for each particle). Look for warpx_add_real_attributes in the linked example.

You can then access the data in the new components using the ParticleContainerWrapper. See the example at https://github.com/ECP-WarpX/WarpX/blob/development/Examples/Tests/particle_data_python/PICMI_inputs_2d.py for how to access the data in a new att…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zhazhajust
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants