How to add particles to grid by their position? #3683
Unanswered
zhazhajust
asked this question in
Q&A
Replies: 1 comment
-
You could look at some of our tutorial codes and even full applications for examples of how to do this. For example, this routine, from our Electromagnetic PIC tutorial, shows how to loop over all the cells and generate a fixed number of particles in each one. This routine, from the WarpX code, shows how to generate particles from arrays of particle positions and other data. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to add some particles for sampling the Mesh Value (such as Electric field) at some positions, and i read the docs at https://amrex-codes.github.io/amrex/docs_html/Particle.html.
But i find the part of "Interacting with Mesh Data" and "Initializing Particle Data" in docs don't seem to involved about the geometry (or positions), so i don't know how to connect the particle and mesh with the real positions.
For example, if there already exists MultiFab and Geometry, and an array for particles postion was generated, and then how could i init the particles so that the ParIter could iter both particles and the MultiFab (mf[pti] could works) with the position according with Geometry.
Beta Was this translation helpful? Give feedback.
All reactions