Geometry

To filter particles in a particular volume, such as a cube, a sphere, or a cylinder, geometries can be used. This package provides a variety of different geometries for multiple dimensions, including the following:

CosmoParticles.geometry_enclosing_cornersFunction
geometry_enclosing_corners(geo::AbstractCosmoGeometry)

Return the lower left and upper right corners of the enclosing box of the geometry as a tuple of vectors.

The enclosing box is not necessarily the tightest fitting box.

This is not exported.

source
CosmoParticles.mask_inFunction
mask_in(pos::AbstractMatrix{<:Number}, geo::AbstractCosmoGeometry)

Return the BitArray mask of the positions ($\mathrm{dims} × N$) located within the geometry.

Calls mask_in! by default.

This is not exported.

source
CosmoParticles.CosmoHyperrectangleType
struct CosmoHyperrectangle{T,N} <: AbstractCosmoGeometry where {T<:Number}
    lowerleft::Vector{T}
    upperright::Vector{T}
end

N-dimensional hyperrectangle aligned with the coordinate system axes given by its lower left and upper right corners.

The dimensions of space are given by N.

source
CosmoParticles.CosmoHypercubeFunction
CosmoHypercube(center::AbstractVector{<:Number}, radius::Number)

Return a cubic CosmoCuboid centered around center, with equal sidelengths.

source
CosmoParticles.CosmoCubeFunction
CosmoCube(center::AbstractVector{<:Number}, radius::Number)

Return a cubic CosmoCuboid centered around center, with equal sidelengths.

source
CosmoParticles.CosmoSquareFunction
CosmoSquare(center::AbstractVector{<:Number}, radius::Number)

Return a square CosmoRectangle centered around center, with equal sidelengths.

source
CosmoParticles.CosmoHypersphereType
struct CosmoHypersphere{T,N} <: AbstractCosmoGeometry where {T<:Number}
    center::Vector{T}
    radius::T
end

N-dimensional hypersphere given by its center and radius.

If different types are passed to the constructor, the types will be promoted without throwing an error.

source
CosmoParticles.CosmoCylinderType
struct CosmoCylinder{T} <: AbstractCosmoGeometry where {T<:Number}
    startpos::Vector{T}
    endpos::Vector{T}
    radius::T
end

Cylinder given by its end points startpos and endpos and radius.

If different types are passed to the constructor, the types will be promoted without throwing an error.

source
CosmoParticles.CosmoStandingCylinderType
struct CosmoStandingCylinder{T} <: AbstractCosmoGeometry where {T<:Number}
    center::Vector{T}
    height::T
    radius::T
end

Standing cylinder given by its center, height, and radius.

Standing means that the cylinder is oriented such that its axis is aligned with the z axis. If different types are passed to the constructor, the types will be promoted without throwing an error.

source
CosmoParticles.CosmoStandingCylinderMethod
CosmoStandingCylinder(c::CosmoCylinder)

Create a standing cylinder from a cylinder.

The end positions of the cylinder have to have the same x and y coordinates.

source