I am looking for a way to write the properties of particles in a system in .VTU format. I read the code for writing the particle info in Particle class, but implementing the code (for instance how to use the ParticleOutput class) to write the information is confusing for me. Does anyone can help me on this issue by sending an example?
Great to hear you are interested in using the particles. I think what you are asking for is already done in the example file here: https://github.com/geodynamics/aspect/blob/master/cookbooks/composition-active-particles.prm. This file is also in your ASPECT directory in the cookbooks/ folder. It should write additional particles-…vtu files that contain the position and properties of all particles in the domain. All of the relevant source code is in this file: https://github.com/geodynamics/aspect/blob/master/source/postprocess/particles.cc.
Let me know if you need anything that the current implementation can not do, and I can likely provide some guidance on how to extent the current version of ParticleOutput.
The problem is fixed thanks to your help.
I have another question: I am writing a class for collision of particles, and I need to map the particles in the cells (what is the cell number each particle is located in) and have a list of particles in each cell of triangulation. I wonder if any classes in ASPECT can help me?
Are you doing this as part of a postprocessor? You might want to look at
how other postprocessors do this, for example this piece of code that
goes through all particles owned by the current processor and stores
their locations in a different data structure:
Thank you for answer.
No, I am writing a DEM code (as a part of Lethe project) based on dealII and I want to use all the available useful classes.
For the contact detection, first I need to find the active cells (cell numbers) around each particle at each time-step and then find the particles located in these cells (again for each particle at each time-step).
Ah, I see – I think asking this question on the deal.II mailing list
would be a better place.
Since this question came up before and to document the replies: I provided an answer at the deal.II mailing list here: https://groups.google.com/forum/#!topic/dealii/U49iAg--i8M