Metrics
- tissue_forge.metrics.relative_position(pos, origin, comp_bc=1)
Computes the relative position with respect to an origin while optionally account for boundary conditions.
If boundaries along a dimension are periodic, then this chooses the relative coordinate closest to the origin.
- Parameters:
pos (
FVector3) – absolute positionorigin (
FVector3) – origincomp_bc (boolean, optional) – flag to compensate for boundary conditions; default true
- Return type:
FVector3- Returns:
FVector3 relative position with respect to the given origin
- tissue_forge.metrics.neighborhood_particles(position, dist, comp_bc=1)
find all particles in a neighborhood defined by a point and distance
- tissue_forge.metrics.calculate_virial(origin, radius, typeIds, tensor)
[in] origin of the sphere where we will comptute the local virial tensor. [in] include all partices a given radius in calculation. [in] vector of type ids to indlude in calculation, if empty, includes all particles. [out] result vector, writes a 3x3 matrix in a row-major in the given location.
If periodoc, we don’t include the periodic image cells, because we only calculate the forces within the simulation volume.
- tissue_forge.metrics.particles_virial(parts, nr_parts, flags, tensor)
calculate the virial tensor for a specific list of particles. currently uses center of mass as origin, may change in the future with different flags.
flags currently ignored.
- tissue_forge.metrics.particles_radius_of_gyration(parts, nr_parts, result)
- Parameters:
result: – pointer to float to store result.
- tissue_forge.metrics.particles_center_of_mass(parts, nr_parts, result)
- Parameters:
result: – pointer to float[3] to store result
- tissue_forge.metrics.particles_center_of_geometry(parts, nr_parts, result)
- Parameters:
result: – pointer to float[3] to store result.
- tissue_forge.metrics.particles_moment_of_inertia(parts, nr_parts, result)
- Parameters:
result: – pointer to float[9] to store result.
- tissue_forge.metrics.cartesian_to_spherical(postion, origin)
converts cartesian to spherical, writes spherical coords in to result array. return FVector3{radius, theta, phi};
- tissue_forge.metrics.particle_neighbors(part, radius, typeIds, nr_parts, parts)
Searches and enumerates a location of space for all particles there.
Allocates a buffer, and stores the results there.
- Parameters:
part (
Particle) – the particleradius (float) – [optional] the radius of the neighborhood
typeIds (std::set< short,std::less< short >,std::allocator< short > >) – [optional] set of type ids to include. If not given, gets all other parts within radius.
nr_parts (int) – [out] number of parts
parts (int) – [out] newly allocated buffer of particle ids.
- tissue_forge.metrics.eigenvals(*args)
Overload 1:
Compute the eigenvalues of a 3x3 matrix
- Parameters:
mat (
FMatrix3) – the matrixsymmetric (boolean, optional) – flag signifying whether the matrix is symmetric
- Return type:
FVector3- Returns:
eigenvalues
Overload 2:
Compute the eigenvalues of a 4x4 matrix
- Parameters:
mat (
FMatrix4) – the matrixsymmetric (boolean, optional) – flag signifying whether the matrix is symmetric
- Return type:
FVector4- Returns:
eigenvalues
- tissue_forge.metrics.eigenvecs_vals(*args)
Overload 1:
Compute the eigenvectors and eigenvalues of a 3x3 matrix
- Parameters:
mat (
FMatrix3) – the matrixsymmetric (boolean, optional) – flag signifying whether the matrix is symmetric
- Return type:
std::pair< TissueForge::FVector3,TissueForge::FMatrix3 >
- Returns:
eigenvalues, eigenvectors
Overload 2:
Compute the eigenvectors and eigenvalues of a 4x4 matrix
- Parameters:
mat (
FMatrix4) – the matrixsymmetric (boolean, optional) – flag signifying whether the matrix is symmetric
- Return type:
std::pair< TissueForge::FVector4,TissueForge::FMatrix4 >
- Returns:
eigenvalues, eigenvectors