Output data for specific tag
Good morning,
Is there a way to output particle data, either via a checkpointer or fieldsaver, such that only particles with a specific tag are saved?
Specifically, I have two groups of particles with tags 1 and 2 respectively, but I'd only like to visualise/process those of tag 2.
Cheers,
Nathan
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Dion Weatherley
- Solved:
- 2019-11-21
- Last query:
- 2019-11-21
- Last reply:
- 2019-11-21
|
#1 |
Hi Nathan,
Yes, there are two FieldSavers specifically for saving particle scalar and vector fields. These are:
* TaggedParticleS
http://
* TaggedParticleV
http://
These work pretty much the same as their ordinary Particle*
e.g. To save the positions of particles whose tag=2, starting at timestep 0 and ending at timestep 10000, every 100 timesteps:
sim.createField
TaggedPartic
fieldName = "position",
fileName = "positions_tag_2",
fileFormat = "RAW",
beginTimeStep = 0,
endTimeStep = 10000,
timeStepIncr = 100,
tag = 2,
mask = -1
)
)
This will generate a numbered series of output files with prefix "positions_tag_2" containing the current positions of each particle whose tag=2.
I hope this helps. Have fun!
Cheers,
Dion
Nathan Di Vaira (ndivaira1) said : | #2 |
Ahh perfect, thanks!