Types

PhysicalParticles.AbstractPointType

AbstractPoint

Top level mathematical vector type defined in PhysicalParticles.jl It is named to distinguish from the built-in type AbstractVector

source
PhysicalParticles.PVectorType
struct PVector{T<:Number} <: AbstractPoint3D{T}

Fields

  • x::T
  • y::T
  • z::T

Examples

julia> PVector()
PVector{Float64}(0.0, 0.0, 0.0)

julia> PVector(u"m")
PVector(0.0 m, 0.0 m, 0.0 m)

julia> PVector() * im
PVector{ComplexF64}(0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im)
source
PhysicalParticles.PVector2DType
struct PVector2D{T<:Number} <: AbstractPoint2D{T}

Fields

  • x::T
  • y::T

Examples

julia> PVector2D()
PVector2D{Float64}(0.0, 0.0)

julia> PVector2D(u"m")
PVector2D(0.0 m, 0.0 m)

julia> PVector(1.0im, 2.0 + 3.0im)
PVector2D{ComplexF64}(0.0 + 1.0im, 2.0 + 3.0im)
source
PhysicalParticles.MasslessType
struct Massless{P, V, I<:Integer} <: AbstractParticle3D
  • Pos::PVector{P} where P

  • Vel::PVector{V} where V

  • ID::Integer

3D particle type without mass.

Examples

julia> Massless()
Massless 0: Pos = PVector{Float64}(0.0, 0.0, 0.0), Vel = PVector{Float64}(0.0, 0.0, 0.0)

julia> Massless(uAstro)
Massless 0: Pos = PVector(0.0 kpc, 0.0 kpc, 0.0 kpc), Vel = PVector(0.0 kpc Gyr^-1, 0.0 kpc Gyr^-1, 0.0 kpc Gyr^-1)

julia> Massless(uSI, id = 1)
Massless 1: Pos = PVector(0.0 m, 0.0 m, 0.0 m), Vel = PVector(0.0 m s^-1, 0.0 m s^-1, 0.0 m s^-1)
source
PhysicalParticles.Massless2DType
struct Massless2D{P, V, I<:Integer} <: AbstractParticle2D
  • Pos::PVector2D{P} where P

  • Vel::PVector2D{V} where V

  • ID::Integer

2D particle type without mass.

Examples

julia> Massless2D()
Massless 0: Pos = PVector2D{Float64}(0.0, 0.0), Vel = PVector2D{Float64}(0.0, 0.0)

julia> Massless2D(uAstro)
Massless 0: Pos = PVector2D(0.0 kpc, 0.0 kpc), Vel = PVector2D(0.0 kpc Gyr^-1, 0.0 kpc Gyr^-1)

julia> Massless2D(uSI, id = 1)
Massless 1: Pos = PVector2D(0.0 m, 0.0 m), Vel = PVector2D(0.0 m s^-1, 0.0 m s^-1)
source
PhysicalParticles.BallType
struct Ball{P, V, A, M, I<:Integer} <: AbstractParticle3D
  • Pos::PVector{P} where P

  • Vel::PVector{V} where V

  • Acc::PVector{A} where A

  • Mass::Any

  • ID::Integer

Basic 3D particle type.

Examples

julia> Ball()
Ball 0: Pos = PVector{Float64}(0.0, 0.0, 0.0), Vel = PVector{Float64}(0.0, 0.0, 0.0), Acc = PVector{Float64}(0.0, 0.0, 0.0), Mass = 0.0

julia> Ball(uAstro)
Ball 0: Pos = PVector(0.0 kpc, 0.0 kpc, 0.0 kpc), Vel = PVector(0.0 kpc Gyr^-1, 0.0 kpc Gyr^-1, 0.0 kpc Gyr^-1), Acc = PVector(0.0 kpc Gyr^-2, 0.0 kpc Gyr^-2, 0.0 kpc Gyr^-2), Mass = 0.0 M⊙

julia> Ball(uSI, id = 1)
Ball 1: Pos = PVector(0.0 m, 0.0 m, 0.0 m), Vel = PVector(0.0 m s^-1, 0.0 m s^-1, 0.0 m s^-1), Acc = PVector(0.0 m s^-2, 0.0 m s^-2, 0.0 m s^-2), Mass = 0.0 kg
source
PhysicalParticles.Ball2DType
struct Ball2D{P, V, A, M, I<:Integer} <: AbstractParticle2D
  • Pos::PVector2D{P} where P

  • Vel::PVector2D{V} where V

  • Acc::PVector2D{A} where A

  • Mass::Any

  • ID::Integer

Basic 2D particle type.

Examples

julia> Ball2D()
Ball 0: Pos = PVector2D{Float64}(0.0, 0.0), Vel = PVector2D{Float64}(0.0, 0.0), Acc = PVector2D{Float64}(0.0, 0.0), Mass = 0.0

julia> Ball2D(uAstro)
Ball 0: Pos = PVector2D(0.0 kpc, 0.0 kpc), Vel = PVector2D(0.0 kpc Gyr^-1, 0.0 kpc Gyr^-1), Acc = PVector2D(0.0 kpc Gyr^-2, 0.0 kpc Gyr^-2), Mass = 0.0 M⊙

julia> Ball2D(uSI, id = 1)
Ball 1: Pos = PVector2D(0.0 m, 0.0 m), Vel = PVector2D(0.0 m s^-1, 0.0 m s^-1), Acc = PVector2D(0.0 m s^-2, 0.0 m s^-2), Mass = 0.0 kg
source
PhysicalParticles.StarType
struct Star{P, V, A, M, E, I<:Integer} <: AbstractParticle3D
  • Pos::PVector{P} where P

  • Vel::PVector{V} where V

  • Acc::PVector{A} where A

  • Mass::Any

  • ID::Integer

  • Collection::Collection

  • Ti_endstep::Integer: Next integer step on the timeline.

  • Ti_begstep::Integer: Present integer step on the timeline.

  • GravCost::Integer: For each two-particle interaction, GravCost += 1

  • Potential::Any: Particle potential in the force field

  • OldAcc::Any: Save the normalization of acceleration of last step. Useful in Tree n-body method.

3D Particle type designed for AstroSim.jl.

Collection is an Enum defined in the same way with Gadget2, but start from 1.

Examples

julia> Star()
Star 0 GAS: Pos = PVector{Float64}(0.0, 0.0, 0.0), Vel = PVector{Float64}(0.0, 0.0, 0.0), Acc = PVector{Float64}(0.0, 0.0, 0.0), Mass = 0.0, Ti_endstep = 0, Ti_begstep = 0, Potential = 0.0, OldAcc = 0.0, Entropy = 0.0, Density = 0.0, Hsml = 0.0, Left = 0.0, Right = 0.0, NumNgbFound = 0, RotVel = PVector{Float64}(0.0, 0.0, 0.0), DivVel = 0.0, CurlVel = 0.0, dHsmlRho = 0.0, Pressure = 0.0, DtEntropy = 0.0, MaxSignalVel = 0.0

julia> Star(uAstro, collection = BLACKHOLE)
Star 0 BLACKHOLE: Pos = PVector(0.0 kpc, 0.0 kpc, 0.0 kpc), Vel = PVector(0.0 kpc Gyr^-1, 0.0 kpc Gyr^-1, 0.0 kpc Gyr^-1), Acc = PVector(0.0 kpc Gyr^-2, 0.0 kpc Gyr^-2, 0.0 kpc Gyr^-2), Mass = 0.0 M⊙, Ti_endstep = 0, Ti_begstep = 0, Potential = 0.0 kpc^2 M⊙ Gyr^-2, OldAcc = 0.0 kpc Gyr^-2, Entropy = 0.0 kpc^2 M⊙ K^-1 Gyr^-2, Density = 0.0 M⊙ kpc^-3, Hsml = 0.0 kpc, Left = 0.0, Right = 0.0, NumNgbFound = 0, RotVel = PVector(0.0 kpc Gyr^-1, 0.0 kpc Gyr^-1, 0.0 kpc Gyr^-1), DivVel = 0.0 Gyr^-1, CurlVel = 0.0 Gyr^-1, dHsmlRho = 0.0 kpc, Pressure = 0.0 M⊙ kpc^-1 Gyr^-2, DtEntropy = 0.0 kpc^2 M⊙ K^-1 Gyr^-3, MaxSignalVel = 0.0 kpc Gyr^-1

julia> Star(uSI, id = 1)
Star 1 GAS: Pos = PVector(0.0 m, 0.0 m, 0.0 m), Vel = PVector(0.0 m s^-1, 0.0 m s^-1, 0.0 m s^-1), Acc = PVector(0.0 m s^-2, 0.0 m s^-2, 0.0 m s^-2), Mass = 0.0 kg, Ti_endstep = 0, Ti_begstep = 0, Potential = 0.0 kg m^2 s^-2, OldAcc = 0.0 m s^-2, Entropy = 0.0 kg m^2 K^-1 s^-2, Density = 0.0 kg m^-3, Hsml = 0.0 m, Left = 0.0, Right = 0.0, NumNgbFound = 0, RotVel = PVector(0.0 m s^-1, 0.0 m s^-1, 0.0 m s^-1), DivVel = 0.0 s^-1, CurlVel = 0.0 s^-1, dHsmlRho = 0.0 m, Pressure = 0.0 kg m^-1 s^-2, DtEntropy = 0.0 
kg m^2 K^-1 s^-3, MaxSignalVel = 0.0 m s^-1
source
PhysicalParticles.Star2DType
struct Star2D{P, V, A, M, E, I<:Integer} <: AbstractParticle2D
  • Pos::PVector2D{P} where P

  • Vel::PVector2D{V} where V

  • Acc::PVector2D{A} where A

  • Mass::Any

  • ID::Integer

  • Collection::Collection

  • Ti_endstep::Integer: Next integer step on the timeline.

  • Ti_begstep::Integer: Present integer step on the timeline.

  • GravCost::Integer: For each two-particle interaction, GravCost += 1

  • Potential::Any: Particle potential in the force field

  • OldAcc::Any: Save the normalization of acceleration of last step. Useful in Tree n-body method

2D Particle type designed for AstroSim.jl. Collection is an Enum defined in the same way with Gadget2, with index starting from 1.

Examples

julia> Star2D()
SPHGas 0 GAS: Pos = PVector2D{Float64}(0.0, 0.0), Vel = PVector2D{Float64}(0.0, 0.0), Acc = PVector2D{Float64}(0.0, 0.0), Mass = 0.0, Ti_endstep = 0, Ti_begstep = 0, Potential = 0.0, OldAcc = 0.0, Entropy = 0.0, Density = 0.0, Hsml = 0.0, Left = 0.0, Right = 0.0, NumNgbFound = 0, RotVel = PVector2D{Float64}(0.0, 0.0), DivVel = 0.0, CurlVel = 0.0, dHsmlRho = 0.0, Pressure = 0.0, DtEntropy = 0.0, MaxSignalVel = 0.0

julia> Star2D(uAstro, collection = BLACKHOLE)
SPHGas 0 BLACKHOLE: Pos = PVector2D(0.0 kpc, 0.0 kpc), Vel = PVector2D(0.0 kpc Gyr^-1, 0.0 kpc Gyr^-1), Acc = PVector2D(0.0 kpc Gyr^-2, 0.0 kpc Gyr^-2), Mass = 0.0 M⊙, Ti_endstep = 0, Ti_begstep = 0, Potential = 0.0 kpc^2 M⊙ Gyr^-2, OldAcc = 0.0 kpc Gyr^-2, 
Entropy = 0.0 kpc^2 M⊙ K^-1 Gyr^-2, Density = 0.0 M⊙ kpc^-2, Hsml = 0.0 kpc, Left = 0.0, Right = 0.0, NumNgbFound = 0, RotVel = PVector2D(0.0 kpc Gyr^-1, 0.0 kpc Gyr^-1), DivVel = 0.0 Gyr^-1, CurlVel = 0.0 Gyr^-1, dHsmlRho = 0.0 kpc, Pressure = 0.0 M⊙ kpc^-1 Gyr^-2, DtEntropy = 0.0 kpc^2 M⊙ K^-1 Gyr^-3, MaxSignalVel = 0.0 kpc Gyr^-1

julia> Star2D(uSI, id = 1)
SPHGas 1 GAS: Pos = PVector2D(0.0 m, 0.0 m), Vel = PVector2D(0.0 m s^-1, 0.0 m s^-1), Acc = PVector2D(0.0 m s^-2, 0.0 m s^-2), Mass = 0.0 kg, Ti_endstep = 0, Ti_begstep = 0, Potential = 0.0 kg m^2 s^-2, OldAcc = 0.0 m s^-2, Entropy = 0.0 kg m^2 K^-1 s^-2, Density = 0.0 kg m^-2, Hsml = 0.0 m, Left = 0.0, Right = 0.0, NumNgbFound = 0, RotVel = PVector2D(0.0 m s^-1, 0.0 m s^-1), DivVel = 0.0 s^-1, CurlVel = 0.0 s^-1, dHsmlRho = 0.0 m, Pressure = 0.0 kg m^-1 s^-2, DtEntropy = 0.0 kg m^2 K^-1 s^-3, MaxSignalVel = 0.0 m s^-1
source
Missing docstring.

Missing docstring for SPHGas. Check Documenter's build log for details.

Missing docstring.

Missing docstring for SPHGas2D. Check Documenter's build log for details.

PhysicalParticles.ExtentType
struct Extent{T<:Number} <: AbstractExtent3D{T}

Could be constructed by function extent

Fields

  • xMin::T
  • xMax::T
  • yMin::T
  • yMax::T
  • zMin::T
  • zMax::T
  • SideLength::T
  • Center::PVector{T}
  • Corner::PVector{T} : PVector(xMin, yMin, zMin)
source
PhysicalParticles.Extent2DType
struct Extent2D{T<:Number} <: AbstractExtent2D{T}

Could be constructed by function extent

Fields

  • xMin::T
  • xMax::T
  • yMin::T
  • yMax::T
  • SideLength::T
  • Center::PVector2D{T}
  • Corner::PVector2D{T} : PVector2D(xMin, yMin)
source
PhysicalParticles.CollectionType
Enum Collection

Particle types defined in Gadget2. However, in julia, it is better to start from 1:

GAS::Collection       = 1
HALO::Collection      = 2
DISK::Collection      = 3
BULGE::Collection     = 4
STAR::Collection      = 5
BLACKHOLE::Collection = 6
source
PhysicalParticles.ConstantType
struct Constant
  • c::Any: light speed

  • G::Any: Newtonian constant of gravitation

  • h::Any: Planck constant

  • e::Any: Elementary charge

  • m_e::Any: Electron mass

  • m_n::Any: Neutron mass

  • m_p::Any: Protron mass

  • σ::Any: Stefan-Boltzmann constant

  • H::Any: Hubble constant

  • k_B::Any: Kelvin-Boltzmann constant

  • ε_0::Any: Vacuum electric permittivity (electric constant)

  • μ_0::Any: Vacuum magnetic permeability

  • ACC0::Any: Modified gravitational acceleration constant

source