From 17d991cda89cf9beee1dd844f1b857aceabb2652 Mon Sep 17 00:00:00 2001 From: islent Date: Thu, 12 Dec 2024 20:14:03 +0800 Subject: [PATCH] fix SphericalSystem total mass, release v0.1.4 --- .github/workflows/CI.yml | 2 +- Project.toml | 2 +- src/spherical.jl | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9070fd1..61b34dc 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: version: - - '1.11.1' + - '1.11.2' os: - ubuntu-latest - macOS-latest diff --git a/Project.toml b/Project.toml index 698edb3..26a8be7 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "AstroIC" uuid = "5b3ca070-48c3-41ea-b469-89825dd01fde" authors = ["islent "] -version = "0.1.3" +version = "0.1.4" [deps] AstroIO = "c85a633c-0c3f-44a2-bffe-7f9d0681b3e7" diff --git a/src/spherical.jl b/src/spherical.jl index ce1a972..3b7697a 100644 --- a/src/spherical.jl +++ b/src/spherical.jl @@ -60,10 +60,10 @@ function generate(config::SphericalSystem, units = uAstro; dx = x[2] - x[1] if config.mass_shell isa Function shell_masses = config.mass_shell.(x) - TotalMass = PhysicalParticles.NumericalIntegration.integrate(x, shell_masses) * ustrip(uLen, dx) + TotalMass = PhysicalParticles.NumericalIntegration.integrate(x, shell_masses) elseif config.mass_shell isa Dict || config.mass_shell isa DataFrame spl = Spline1D(ustrip.(uLen, config.mass_shell["r"]), ustrip.(uMass/uLen, config.mass_shell["m"])) - TotalMass = PhysicalParticles.NumericalIntegration.integrate(x, spl(ustrip.(uLen, x))*uMass/uLen) * ustrip(uLen, dx) + TotalMass = PhysicalParticles.NumericalIntegration.integrate(x, spl(ustrip.(uLen, x))*uMass/uLen) end pos = rand_pos_3d.(R)