MissingElementError: No particles exist for particle type '0'

Kojo Atta
Kojo Atta Altair Community Member
edited February 16 in Community Q&A

Hello,

I'm trying to extract particle ID and position data with the codes below, but I get the error message "MissingElementError: No particles exist for particle type '0'".

IDs1, x, y, z = deck.timestep[2].particle[0].getBinnedProperty(nX, nY, nZ, iMin, iMax, option='ids')

pos1, x, y, z = deck.timestep[2].particle[0].getBinnedProperty(nX, nY, nZ, iMin, iMax, option='position')

I have also tried with "........particle['Actual particle name']...............", but the same error pops up.

The code is supposed to extract the properties for about 46,000 out of 6 million particles from a grid bin in my simulation. Also, the same code works with another simulation with only 50 particles. 

Please could anyone suggest some solutions for me? Thank you.

Tagged:

Answers

  • Stefan Pantaleev_21979
    Stefan Pantaleev_21979
    Altair Employee
    edited February 15

    Hi Kojo,

    It looks like there are no particles of type 0 in your simulation but you are trying to access their properties. This may occur if you haven't introduced this particle type into the simulation in the timestep that you are processing.

    It may also be that you deleted the 0 particle type and created another in EDEM or changed the particle properties of type 0 midway through the simulation which would prompt the creation of a new particle type in EDEM. The best way to check is to install free HDF5View or another .h5 file reader and review the .h5 files in the _data folder of the simulation to see if particle type 0 exists and is being created.

    If it is simply a matter of type 0 not being present in timestep 2 and you'd like to loop through that tstep anyway you could uses something like the below.

    try:

     Code here

    except:

        pass

    Best regards,

    Stefan

     

     

     

  • Kojo Atta
    Kojo Atta Altair Community Member
    edited February 15

    Hi Kojo,

    It looks like there are no particles of type 0 in your simulation but you are trying to access their properties. This may occur if you haven't introduced this particle type into the simulation in the timestep that you are processing.

    It may also be that you deleted the 0 particle type and created another in EDEM or changed the particle properties of type 0 midway through the simulation which would prompt the creation of a new particle type in EDEM. The best way to check is to install free HDF5View or another .h5 file reader and review the .h5 files in the _data folder of the simulation to see if particle type 0 exists and is being created.

    If it is simply a matter of type 0 not being present in timestep 2 and you'd like to loop through that tstep anyway you could uses something like the below.

    try:

     Code here

    except:

        pass

    Best regards,

    Stefan

     

     

     

    Hi Stefan, thanks for the reply.

    After generating the particles to create my soil bin, I exported a simulation deck to run many subsequent simulations. Could that have changed the particles’ properties? Also, with the .h5 reader, do you mean I can see the new particles properties and use it to update the code? Thanks.

    Regards,

    Kojo

  • Stefan Pantaleev_21979
    Stefan Pantaleev_21979
    Altair Employee
    edited February 16
    Kojo Atta said:

    Hi Stefan, thanks for the reply.

    After generating the particles to create my soil bin, I exported a simulation deck to run many subsequent simulations. Could that have changed the particles’ properties? Also, with the .h5 reader, do you mean I can see the new particles properties and use it to update the code? Thanks.

    Regards,

    Kojo

    Hi Kojo,

    A deck export on its own shouldn't change the particle type indexing but maybe a change before the export caused it. In any case you can take a look at the .h5 files and see what particle types are currently defined and which are present in the domain and modify the code accordingly. You can also do this via EDEMpy wthe the particle class:

    class edempy.timestep.ParticleType.ParticleType

    Take a look at the documentation in EDEM install directory/EDEMpy/help/index.html

    Best regards,

    Stefan