Table Of Contents

Previous topic

main Package

Next topic

ode Package

This Page

measures Package

measures Package

elastic_potential_energy Module

class pyparticles.measures.elastic_potential_energy.ElasticPotentialEnergy(pset=None, force=None)

Bases: pyparticles.measures.measure.Measure

Class derived from Measure usedfor computing the total elastic potential energy of the particle system

dim()

return the dimension of the measure: 1 for the potential energy

name()

Return the string: “potential energy”

shape()

return a tuple containing the shape of the measures dataset

update_measure()

Compute and return the elestic potential energy on the current state of the pset

value()

return the current value of the potential energy

gravitational_potential_energy Module

class pyparticles.measures.gravitational_potential_energy.GravitationalPotentialEnergy(pset=None, force=None)

Bases: pyparticles.measures.measure.Measure

Class derived from Measure usedfor computing the total gravitational potential energy of the particle system

dim()

return the dimension of the measure: 1 for the potential energy

name()

Return the string: “potential energy”

shape()

return a tuple containing the shape of the measures dataset

update_measure()

Compute and return the elestic potential energy on the current state of the pset

value()

return the current value of the potential energy

kinetic_energy Module

class pyparticles.measures.kinetic_energy.KineticEnergy(pset=None, force=None)

Bases: pyparticles.measures.measure.Measure

Mesure for computing the total potential energy of the particle system

dim()

return the dimension of the measure: 1 for the potential energy

name()

Return the string: “potential energy”

shape()

return a tuple containing the shape of the measures dataset

update_measure()

Compute and return the elestic potential energy on the current state of the pset

value()

return the current value of the potential energy

mass Module

class pyparticles.measures.mass.Mass(pset=None, force=None)

Bases: object

‘Meaure’ for computing the total mass of the particle system

dim()

return the dimension of the measure: 1 for the mass

name()

Return the string: “mass”

shape()

return a tuple containing the shape of the measures dataset

update_measure()

Compute and return the totale mass of the system

value()

Return the current measured total mass

measure Module

class pyparticles.measures.measure.Measure(pset=None, force=None)

Bases: object

Main abstract class for defining the measurement procedures of the system, for example the total kinetic energy.

dim()

return the dimension of the measure, for the dimensionless measure it must return 1 (like kinetic energy or mass)

force

set and get the current force model

get_force()
get_parameter(name, val)

return the reference to the dict of the used parameter A parameter should be the volume, some constant ....

get_pset()
get_str_format()
name()

return a string containig the name of the measure

parameter

return the reference to the dict of the used paramenter

pset

set and get the current measured particle set

set_force(force)
set_pset(pset)
set_str_format(f='%5.3f')
shape()

return a tuple containing the shape of the measures dataset

str_format

get ad set the string format for representing the value

update_measure()

compute and return the value of the measured quantity

value()

Return the value of the current measure

value_str()

return a string containig the value of the current neasure formmatted according to the format defined with the str_property format. By default if uses the simple floaf format

class pyparticles.measures.measure.MeasureParticles(pset=None, force=None, subset=None, model='part_by_part')

Bases: pyparticles.measures.measure.Measure

Abstract class used fopr measuring a subset of partiles or a set of singles particles.

get_model()
get_subset()
model

set and get the measurement model: “part_by_part” or “subsystem”

set_model(model)
set_subset(subset)
subset

get and set the subset of particles to be measured

momentum Module

class pyparticles.measures.momentum.MomentumParticles(pset=None, force=None, subset=None, model='part_by_part')

Bases: pyparticles.measures.measure.MeasureParticles

‘Measure’ for computing the momentum particle by particle or of a subsystem Example:

P = MomentumParticles( pset , subset=np.array([1,4,5]) , model="part_by_part")
P.update_measure()
print( P.value )
>    [[ 1.1 , 2.3 , 3.2 ],
>     [ 1.7 , 5.2 , 6.9 ],
>     [ 1.8 , 2.3 , 1.7 ]
>    ]

Constructor:

:param pset The particles set :param force The model of the used force :param subset a numpy 1D array containing the indicies of the measured particles :param model a strung describing the model for the measure: “part_by_part” or “subsystem”

dim()

return the dimension of the measure: Dim: (2D or 3D) for the momentum

name()

Return the string: “momentum”

shape()

return a tuple containing the shape of the measures dataset

update_measure()

Compute and return the total momentum of the specified particles

value()

return the current value of the momentum

class pyparticles.measures.momentum.MomentumSystem(pset=None)

Bases: pyparticles.measures.measure.Measure

‘Measure’ for computing the total momentum of the particle system

dim()

return the dimension of the measure: Dim for the momentum

name()

Return the string: “momentum”

shape()

return a tuple containing the shape of the measures dataset

update_measure()

Compute and return the total momentum of the system

value()

return the current value of the total momentum

total_energy Module

class pyparticles.measures.total_energy.TotalEnergy(kinetic, potential)

Bases: pyparticles.measures.measure.Measure

Class derived from Measure used for computing the total energy of the particle system
given a potential and a kinetic energy it simply sum the two value
dim()

return the dimension of the measure: 1 for the energy

name()

Return the string: “total energy”

shape()

return a tuple containing the shape of the measures dataset

update_measure()

Compute and return the total energy on the current state of pset

value()

return the current value of the potential energy