ParticleList and ParticleTypeList
- class tissue_forge.ParticleList(*args)
A special list with convenience methods for working with sets of particles.
- property virial
Virial tensor of particles in list
- property radius_of_gyration
Radius of gyration of particles in list
- property center_of_mass
Center of mass of particles in list
- property centroid
Centroid of particles in list
- property moment_of_inertia
Moment of inertia of particles in list
- property positions
Position of each particle in list
- property velocities
Velocity of each particle in list
- property forces
Net forces acting on each particle in list
- property ownsdata: bool
Whether the list owns its data
- property mutable: bool
Whether the list is mutable
- has(*args) bool
Overload 1: Test whether the list has an id
Overload 2: Test whether the list has a particle
- __len__() int
- __getitem__(i: int)
- __contains__(item)
- reserve(_nr_parts: size_t) HRESULT
Reserve enough storage for a given number of items.
- Parameters:
_nr_parts (int) – number of items
- Return type:
int
- Returns:
HRESULT
- insert(*args) uint16_t
Inserts the given particle into the list, returns the index of the item.
- Parameters:
particle (
ParticleHandle
) – particle to insert- Return type:
int
- Returns:
uint16_t
- remove(id: int32_t) uint16_t
looks for the item with the given id and deletes it form the list
- Parameters:
id (int) – id to remove
- Return type:
int
- Returns:
uint16_t
- extend(other: ParticleList) uint16_t
inserts the contents of another list
- Parameters:
other (
ParticleList
) – another list
- item(i: int32_t const &) TissueForge::ParticleHandle *
looks for the item at the given index and returns it if found, otherwise returns NULL
- Parameters:
i (int) – index of lookup
- Return type:
- Returns:
ParticleHandle*
- vector() std::vector< int32_t,std::allocator< int32_t > >
returns the list as a vector
- static all() TissueForge::ParticleList
returns an instance populated with all current particles
- Return type:
- Returns:
ParticleList*
- sphericalPositions(origin: fVector3 = None) std::vector< TissueForge::FVector3,std::allocator< TissueForge::FVector3 > >
Get the spherical coordinates of each particle
- Parameters:
origin (
FVector3
) – optional origin of coordinates; default is center of universe- Return type:
std::vector< TissueForge::FVector3,std::allocator< TissueForge::FVector3 > >
- Returns:
std::vector<FVector3>
- toString() std::string
Get a JSON string representation
- Return type:
string
- Returns:
std::string
- static fromString(str: std::string const &) TissueForge::ParticleList *
Create from a JSON string representation
- Parameters:
str (string) –
- Return type:
- Returns:
ParticleList*
- __reduce__()
Helper for pickle.
- class tissue_forge.ParticleTypeList(*args)
A special list with convenience methods for working with sets of particle types.
- property virial
Virial tensor of particles corresponding to all types in list
- property radius_of_gyration
Radius of gyration of particles corresponding to all types in list
- property center_of_mass
Center of mass of particles corresponding to all types in list
- property centroid
Centroid of particles corresponding to all types in list
- property moment_of_inertia
Moment of inertia of particles corresponding to all types in list
- property positions
Position of each particle corresponding to all types in list
- property velocities
Velocity of each particle corresponding to all types in list
- property forces
Total net force acting on each particle corresponding to all types in list
- property ownsdata: bool
Whether the list owns its data
- property mutable: bool
Whether the list is mutable
- has(*args) bool
Overload 1: Test whether the list has an id
Overload 2: Test whether the list has a particle type
Overload 3: Test whether the list has a particle
- __len__() int
- __getitem__(i: int)
- __contains__(item)
- reserve(_nr_parts: size_t) HRESULT
Reserve enough storage for a given number of items.
- Parameters:
_nr_parts (int) – number of items
- Return type:
int
- Returns:
HRESULT
- insert(*args) uint16_t
Inserts the given particle type into the list, returns the index of the item.
- Parameters:
ptype (
ParticleType
) –- Return type:
int
- Returns:
uint16_t
- remove(id: int32_t) uint16_t
looks for the item with the given id and deletes it form the list
- Parameters:
id (int) – id to remove
- Return type:
int
- Returns:
uint16_t
- extend(other: ParticleTypeList) uint16_t
inserts the contents of another list
- Parameters:
other (
ParticleTypeList
) – another list
- item(i: int32_t const &) TissueForge::ParticleType *
looks for the item at the given index and returns it if found, otherwise returns NULL
- Parameters:
i (int) – index of lookup
- Return type:
- Returns:
ParticleType*
- vector() std::vector< int32_t,std::allocator< int32_t > >
returns the list as a vector
- static all() TissueForge::ParticleTypeList
returns an instance populated with all current particle types
- Return type:
- Returns:
ParticleTypeList*
- sphericalPositions(origin: fVector3 = None) std::vector< TissueForge::FVector3,std::allocator< TissueForge::FVector3 > >
Get the spherical coordinates of each particle
- Parameters:
origin (
FVector3
) – optional origin of coordinates; default is center of universe- Return type:
std::vector< TissueForge::FVector3,std::allocator< TissueForge::FVector3 > >
- Returns:
std::vector<FVector3>
- toString() std::string
Get a JSON string representation
- Return type:
string
- Returns:
std::string
- static fromString(str: std::string const &) TissueForge::ParticleTypeList *
Create from a JSON string representation
- Parameters:
str (string) –
- Return type:
- Returns:
ParticleTypeList*
- __reduce__()
Helper for pickle.