Skip to content

Commit

Permalink
Bump patch
Browse files Browse the repository at this point in the history
  • Loading branch information
henry2004y committed Aug 3, 2024
1 parent a5b2966 commit 14de4e2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 20 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TestParticle"
uuid = "953b605b-f162-4481-8f7f-a191c2bb40e3"
authors = ["Hongyang Zhou <[email protected]>, and Tiancheng Liu <[email protected]>"]
version = "0.11.1"
version = "0.11.2"

[deps]
ChunkSplitters = "ae650224-84b6-46f8-82ea-d812ca08434e"
Expand All @@ -22,7 +22,7 @@ ChunkSplitters = "2"
Elliptic = "1"
ForwardDiff = "0.10"
Interpolations = "0.14, 0.15"
Meshes = "0.44, 0.45, 0.46, 0.47"
Meshes = "0.47"
PrecompileTools = "1"
SciMLBase = "2.24"
SpecialFunctions = "1.5, 2"
Expand Down
2 changes: 1 addition & 1 deletion src/TestParticle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using SciMLBase: AbstractODEProblem, AbstractODEFunction, AbstractODESolution, R
DEFAULT_SPECIALIZATION, ODEFunction,
LinearInterpolation
using StaticArrays: SVector, @SMatrix, MVector, SA
using Meshes: coords, spacing, embeddim, CartesianGrid
using Meshes: coords, spacing, paramdim, CartesianGrid
using ForwardDiff
using ChunkSplitters
using PrecompileTools: @setup_workload, @compile_workload
Expand Down
4 changes: 2 additions & 2 deletions src/prepare.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ function prepare(grid::CartesianGrid, E::TE, B::TB; species::Species=Proton,

q, m = getchargemass(species, q, m)

if embeddim(grid) == 3
if paramdim(grid) == 3
gridx, gridy, gridz = makegrid(grid)
E = TE <: AbstractArray ? getinterp(E, gridx, gridy, gridz, order, bc) : E
B = TB <: AbstractArray ? getinterp(B, gridx, gridy, gridz, order, bc) : B
elseif embeddim(grid) == 2
elseif paramdim(grid) == 2
gridx, gridy = makegrid(grid)
E = TE <: AbstractArray ? getinterp(E, gridx, gridy, order, bc) : E
B = TB <: AbstractArray ? getinterp(B, gridx, gridy, order, bc) : B
Expand Down
23 changes: 8 additions & 15 deletions src/utility/utility.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,20 @@ function getchargemass(species::Species, q::AbstractFloat, m::AbstractFloat)
end

"Return uniform range from 2D/3D CartesianGrid."
function makegrid(grid::CartesianGrid{3, T}) where T
function makegrid(grid::CartesianGrid)
gridmin = coords(minimum(grid))
gridmax = coords(maximum(grid))
Δx = spacing(grid)
dim = paramdim(grid)

gridx = range(gridmin.x.val, gridmax.x.val, step=Δx[1].val)
gridy = range(gridmin.y.val, gridmax.y.val, step=Δx[2].val)
gridz = range(gridmin.z.val, gridmax.z.val, step=Δx[3].val)

gridx, gridy, gridz
end

function makegrid(grid::CartesianGrid{2, T}) where T
gridmin = coords(minimum(grid))
gridmax = coords(maximum(grid))
Δx = spacing(grid)

gridx = range(gridmin.x.val, gridmax.x.val, step=Δx[1].val)
gridy = range(gridmin.y.val, gridmax.y.val, step=Δx[2].val)

gridx, gridy
if dim == 3
gridz = range(gridmin.z.val, gridmax.z.val, step=Δx[3].val)
return gridx, gridy, gridz
elseif dim == 2
return gridx, gridy
end
end

"""
Expand Down

2 comments on commit 14de4e2

@henry2004y
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/112351

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.11.2 -m "<description of version>" 14de4e2c24799e30a2166cb29c79b3b17d5d6c21
git push origin v0.11.2

Please sign in to comment.