Properties

CosmoParticles.sumpropFunction
sumprop(p::AbstractParticles, prop::Symbol)

Returns the sum of the specified property over all particles.

source
CosmoParticles.meanpropFunction
meanprop(p::AbstractParticles, prop::Symbol; massprop=:mass, massweighted::Bool=true)

Returns the mean of the specified property over all particles.

The mean can be weighted by the mass.

source
CosmoParticles.meanposFunction
meanpos(p::AbstractParticles, prop::Symbol=:pos; massprop=:mass, massweighted=true)

Returns the mean of the particles' positions.

The mean can be weighted by the mass.

source
CosmoParticles.meanvelFunction
meanvel(p::AbstractParticles, prop::Symbol=:pos; massprop=:mass, massweighted=true)

Returns the mean of the particles' velocities.

The mean can be weighted by the mass.

source
CosmoParticles.angmomFunction
angmom(p::AbstractParticles)

Returns the individual angular momenta of the particles.

If angmomprop is a Symbol, the already computed angular momenta are returned directly if they exist.

Keyword Arguments

  • origin=Nothing: origin of the coordinate system for the computation of the angular momentum
  • velorigin=Nothing: relative velocity zero-point, oftentimes the velocity of the center of mass
  • posprop=:pos: property name of the position
  • velprop=:vel: property name of the velocity
  • massprop=:mass: property name of the mass
  • angmomprop=nothing: property name of the angular momentum - the method checks whether it already exists or not. Warning: The method assumes the already saved property to have used the same origin and velorigin.
source
angmom(pos::AbstractMatrix, vel::AbstractMatrix, mass; origin=nothing, velorigin=nothing)

Returns the angular momentum based on the positions, velocities, and masses.

Both input matrices need to have the same dimensions $3 × N$. The mass can be a vector or a scalar value (useful if all particles have the same mass).

The coordinate system's origin can be passed as a vector of length 3, as well as the velocity origin, which determines the relative velocity at which the angular momentum should be determined. Typically, this will be the velocity of the center of mass.

source
CosmoParticles.angmomtotFunction
angmomtot(p::AbstractParticles)

Returns the total angular momentum of the particles.

If angmomprop is a Symbol, the total angular momentum is computed from the already existing angular momenta.

Keyword Arguments

  • origin=Nothing: origin of the coordinate system for the computation of the angular momentum
  • velorigin=Nothing: relative velocity zero-point, oftentimes the velocity of the center of mass
  • posprop=:pos: property name of the position
  • velprop=:vel: property name of the velocity
  • massprop=:mass: property name of the mass
  • angmomprop=nothing: property name of the angular momentum - the method checks whether it already exists or not. Warning: The method assumes the already saved property to have used the same origin and velorigin.
source
angmomtot(pos::AbstractMatrix, vel::AbstractMatrix, mass; origin=nothing, velorigin=nothing)

Returns the total angular momentum based on the positions, velocities, and masses.

Both input matrices need to have the same dimensions $3 × N$. The mass can be a vector or a scalar value (useful if all particles have the same mass).

The coordinate system's origin can be passed as a vector of length 3, as well as the velocity origin, which determines the relative velocity at which the angular momentum should be determined. Typically, this will be the velocity of the center of mass.

This method never allocates the full angular momentum matrix for all particles like angmom does. Use this when the individual particle angular momenta are not needed.

source
CosmoParticles.angmomtot_stableFunction
angmomtot_stable(pos::AbstractMatrix, vel::AbstractMatrix, mass; origin=nothing, velorigin=nothing)

Returns the total angular momentum based on the positions, velocities, and masses, like angmomtot.

Uses the stable summation algorithm Base.sum for the summation, but is almost three times slower than angmomtot.

See angmomtot for the available keyword arguments.

source
CosmoParticles.colnormFunction
colnorm(a::AbstractMatrix[, origin::AbstractVector])

Returns a new Vector with the columnwise norms of a around origin.

This method does not check for overflow of the squared norm.

source
CosmoParticles.colnorm2Function
colnorm2(a::AbstractMatrix[, origin:AbstractVector])

Returns a new Vector with the columnwise squared norms of a around origin.

source
CosmoParticles.coldotFunction
coldot(a::AbstractMatrix, b::AbstractMatrix)

Returns the dot products of the matrix columns as a new matrix.

Both input matrices need to have the same dimensions $d × N$, representing $N$ $d$-dimensional vectors.

source
CosmoParticles.colcrossFunction
colcross(a::AbstractMatrix, b::AbstractMatrix)

Returns the cross products of the matrix columns as a new matrix.

Both input matrices need to have the same dimensions $3 × N$.

source