espressopp.storage.Storage

This is the base class for all storage objects. All derived classes implement at least the following methods:

  • decompose()

    Send all particles to their corresponding cell/cpu

  • addParticle(pid, pos):

    Add a particle to the storage

  • removeParticle(pid):

    Remove a particle with id number pid from the storage.

    >>> system.storage.removeParticle(4)
    

    There is an example in examples folder

  • getParticle(pid):

    Get a particle object. This can be used to get specific particle information:

    >>> particle = system.storage.getParticle(15)
    >>> print "Particle ID is       : ", particle.id
    >>> print "Particle position is : ", particle.pos
    

    you cannot use this particle object to modify particle data. You have to use the modifyParticle command for that (see below).

  • addAdrParticle(pid, pos, last_pos):

    Add an AdResS Particle to the storage

  • setFixedTuplesAdress(fixed_tuple_list):

  • addParticles(particle_list, *properties):

    This routine adds particles with certain properties to the storage.

    param particleList:
     list of particles (and properties) to be added
    param properties:
     property strings

    Each particle in the list must be itself a list where each entry corresponds to the property specified in properties.

    Example:

    >>> addParticles([[id, pos, type, ... ], ...], 'id', 'pos', 'type', ...)
    
  • modifyParticle(pid, property, value, decompose=’yes’)

    This routine allows to modify any properties of an already existing particle.

    Example:

    >>> modifyParticle(pid, 'pos', Real3D(new_x, new_y, new_z))
    
  • removeAllParticles():

    This routine removes all particles from the storage.

  • ‘system’:

    The property ‘system’ returns the System object of the storage.

Examples:

>>> s.storage.addParticles([[1, espressopp.Real3D(3,3,3)], [2, espressopp.Real3D(4,4,4)]],'id','pos')
>>> s.storage.decompose()
>>> s.storage.modifyParticle(15, 'pos', Real3D(new_x, new_y, new_z))
espressopp.storage.Storage.addAdrATParticle(pid, *args)
Parameters:
  • pid
  • *args
Return type:

espressopp.storage.Storage.addParticle(pid, pos)
Parameters:
  • pid
  • pos
Return type:

espressopp.storage.Storage.addParticles(particleList, *properties)
Parameters:
  • particleList
  • *properties
Return type:

espressopp.storage.Storage.clearSavedPositions()
Return type:
espressopp.storage.Storage.getParticle(pid)
Parameters:pid
Return type:
espressopp.storage.Storage.getRealParticleIDs()
Return type:
espressopp.storage.Storage.modifyParticle(pid, property, value)
Parameters:
  • pid
  • property
  • value
Return type:

espressopp.storage.Storage.particleExists(pid)
Parameters:pid
Return type:
espressopp.storage.Storage.printRealParticles()
Return type:
espressopp.storage.Storage.removeAllParticles()
Return type:
espressopp.storage.Storage.removeParticle(pid)
Parameters:pid
Return type:
espressopp.storage.Storage.restorePositions()
Return type:
espressopp.storage.Storage.savePositions(idList)
Parameters:idList
Return type:
espressopp.storage.Storage.setFixedTuplesAdress(fixedtuples)
Parameters:fixedtuples