Skip to content

Commit

Permalink
Merge pull request #149 from WaterLily-jl/mutable-sim
Browse files Browse the repository at this point in the history
Make Simulation mutable and loc(T=Float32)
  • Loading branch information
weymouth authored Jul 22, 2024
2 parents 7aaa9b8 + 73475d2 commit d23ac35
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/WaterLily.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Constructor for a WaterLily.jl simulation:
See files in `examples` folder for examples.
"""
struct Simulation
mutable struct Simulation
U :: Number # velocity scale
L :: Number # length scale
ϵ :: Number # kernel width
Expand Down
2 changes: 1 addition & 1 deletion src/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ using StaticArrays
Location in space of the cell at CartesianIndex `I` at face `i`.
Using `i=0` returns the cell center s.t. `loc = I`.
"""
@inline loc(i,I::CartesianIndex{N}) where N = SVector{N}(I.I .- 1.5 .- 0.5 .* δ(i,I).I)
@inline loc(i,I::CartesianIndex{N},T=Float32) where N = SVector{N,T}(I.I .- 1.5 .- 0.5 .* δ(i,I).I)
@inline loc(Ii::CartesianIndex) = loc(last(Ii),Base.front(Ii))
Base.last(I::CartesianIndex) = last(I.I)
Base.front(I::CartesianIndex) = CI(Base.front(I.I))
Expand Down
2 changes: 1 addition & 1 deletion test/maintests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ end
end
import WaterLily: ×
@testset "Metrics.jl" begin
J = CartesianIndex(2,3,4); x = loc(0,J); px = prod(x)
J = CartesianIndex(2,3,4); x = loc(0,J,Float64); px = prod(x)
for f arrays
u = zeros(3,4,5,3) |> f; apply!((i,x)->x[i]+prod(x),u)
p = zeros(3,4,5) |> f
Expand Down

4 comments on commit d23ac35

@weymouth
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register

Release notes: WaterLily 1.2

Breaking change (and big improvements) to the force routines #113
And small (shouldn't be breaking) change to make a Simulation mutable #149

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Error while trying to register: Changing package repo URL not allowed, please submit a pull request with the URL change to the target registry and retry.

@weymouth
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register

Release notes: WaterLily 1.2

Breaking change (and big improvements) to the force routines #113
And small (shouldn't be breaking) change to make a Simulation mutable #149

@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/111538

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 v1.2.0 -m "<description of version>" d23ac35501fbe77584bfdea1c05b6850b1239a1f
git push origin v1.2.0

Please sign in to comment.