Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
TissueForge::metrics Namespace Reference

Tissue Forge simulation metrics. More...

Functions

FVector3 relativePosition (const FVector3 &pos, const FVector3 &origin, const bool &comp_bc=true)
 Computes the relative position with respect to an origin while optionally account for boundary conditions.
 
ParticleList neighborhoodParticles (const FVector3 &position, const FloatP_t &dist, const bool &comp_bc=true)
 
HRESULT calculateVirial (FloatP_t *origin, FloatP_t radius, const std::set< short int > &typeIds, FloatP_t *tensor)
 
HRESULT particlesVirial (int32_t *parts, uint16_t nr_parts, uint32_t flags, FloatP_t *tensor)
 
HRESULT particlesRadiusOfGyration (int32_t *parts, uint16_t nr_parts, FloatP_t *result)
 
HRESULT particlesCenterOfMass (int32_t *parts, uint16_t nr_parts, FloatP_t *result)
 
HRESULT particlesCenterOfGeometry (int32_t *parts, uint16_t nr_parts, FloatP_t *result)
 
HRESULT particlesMomentOfInertia (int32_t *parts, uint16_t nr_parts, FloatP_t *result)
 
FVector3 cartesianToSpherical (const FVector3 &postion, const FVector3 &origin)
 
HRESULT particleNeighbors (struct Particle *part, FloatP_t radius, const std::set< short int > *typeIds, uint16_t *nr_parts, int32_t **parts)
 
std::vector< std::vector< std::vector< ParticleList > > > particleGrid (const iVector3 &shape)
 
HRESULT particleGrid (const iVector3 &shape, ParticleList *result)
 
FVector3 eigenVals (const FMatrix3 &mat, const bool &symmetric=false)
 Compute the eigenvalues of a 3x3 matrix.
 
FVector4 eigenVals (const FMatrix4 &mat, const bool &symmetric=false)
 Compute the eigenvalues of a 4x4 matrix.
 
std::pair< FVector3 FMatrix3eigenVecsVals (const FMatrix3 &mat, const bool &symmetric=false)
 Compute the eigenvectors and eigenvalues of a 3x3 matrix.
 
std::pair< FVector4 FMatrix4eigenVecsVals (const FMatrix4 &mat, const bool &symmetric=false)
 Compute the eigenvectors and eigenvalues of a 4x4 matrix.
 

Detailed Description

Tissue Forge simulation metrics.

Function Documentation

◆ calculateVirial()

HRESULT TissueForge::metrics::calculateVirial ( FloatP_t * origin,
FloatP_t radius,
const std::set< short int > & typeIds,
FloatP_t * tensor )

@origin [in] origin of the sphere where we will comptute the local virial tensor. @radius [in] include all partices a given radius in calculation. @typeIds [in] vector of type ids to indlude in calculation, if empty, includes all particles. @tensor [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.

◆ cartesianToSpherical()

FVector3 TissueForge::metrics::cartesianToSpherical ( const FVector3 & postion,
const FVector3 & origin )

converts cartesian to spherical, writes spherical coords in to result array. return FVector3{radius, theta, phi};

◆ eigenVals() [1/2]

FVector3 TissueForge::metrics::eigenVals ( const FMatrix3 & mat,
const bool & symmetric = false )

Compute the eigenvalues of a 3x3 matrix.

Parameters
matthe matrix
symmetricflag signifying whether the matrix is symmetric
Returns
eigenvalues

◆ eigenVals() [2/2]

FVector4 TissueForge::metrics::eigenVals ( const FMatrix4 & mat,
const bool & symmetric = false )

Compute the eigenvalues of a 4x4 matrix.

Parameters
matthe matrix
symmetricflag signifying whether the matrix is symmetric
Returns
eigenvalues

◆ eigenVecsVals() [1/2]

std::pair< FVector3 FMatrix3 > TissueForge::metrics::eigenVecsVals ( const FMatrix3 & mat,
const bool & symmetric = false )

Compute the eigenvectors and eigenvalues of a 3x3 matrix.

Parameters
matthe matrix
symmetricflag signifying whether the matrix is symmetric
Returns
eigenvalues, eigenvectors

◆ eigenVecsVals() [2/2]

std::pair< FVector4 FMatrix4 > TissueForge::metrics::eigenVecsVals ( const FMatrix4 & mat,
const bool & symmetric = false )

Compute the eigenvectors and eigenvalues of a 4x4 matrix.

Parameters
matthe matrix
symmetricflag signifying whether the matrix is symmetric
Returns
eigenvalues, eigenvectors

◆ neighborhoodParticles()

ParticleList TissueForge::metrics::neighborhoodParticles ( const FVector3 & position,
const FloatP_t & dist,
const bool & comp_bc = true )

find all particles in a neighborhood defined by a point and distance

◆ particleGrid()

std::vector< std::vector< std::vector< ParticleList > > > TissueForge::metrics::particleGrid ( const iVector3 & shape)

Creates an array of ParticleList objects.

◆ particleNeighbors()

HRESULT TissueForge::metrics::particleNeighbors ( struct Particle * part,
FloatP_t radius,
const std::set< short int > * typeIds,
uint16_t * nr_parts,
int32_t ** parts )

Searches and enumerates a location of space for all particles there.

Allocates a buffer, and stores the results there.

Parameters
partthe particle
radius[optional] the radius of the neighborhood
typeIds[optional] set of type ids to include. If not given, gets all other parts within radius.
nr_parts[out] number of parts
parts[out] newly allocated buffer of particle ids.

◆ particlesCenterOfGeometry()

HRESULT TissueForge::metrics::particlesCenterOfGeometry ( int32_t * parts,
uint16_t nr_parts,
FloatP_t * result )
Parameters
resultpointer to float[3] to store result.

◆ particlesCenterOfMass()

HRESULT TissueForge::metrics::particlesCenterOfMass ( int32_t * parts,
uint16_t nr_parts,
FloatP_t * result )
Parameters
resultpointer to float[3] to store result

◆ particlesMomentOfInertia()

HRESULT TissueForge::metrics::particlesMomentOfInertia ( int32_t * parts,
uint16_t nr_parts,
FloatP_t * result )
Parameters
resultpointer to float[9] to store result.

◆ particlesRadiusOfGyration()

HRESULT TissueForge::metrics::particlesRadiusOfGyration ( int32_t * parts,
uint16_t nr_parts,
FloatP_t * result )
Parameters
resultpointer to float to store result.

◆ particlesVirial()

HRESULT TissueForge::metrics::particlesVirial ( int32_t * parts,
uint16_t nr_parts,
uint32_t flags,
FloatP_t * 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.

◆ relativePosition()

FVector3 TissueForge::metrics::relativePosition ( const FVector3 & pos,
const FVector3 & origin,
const bool & comp_bc = true )

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
posabsolute position
originorigin
comp_bcflag to compensate for boundary conditions; default true
Returns
FVector3 relative position with respect to the given origin