Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ConformalCubedSphere grid via MultiRegion module #2867

Merged
merged 299 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
299 commits
Select commit Hold shift + click to select a range
d3e28a4
show methods
navidcy Mar 2, 2023
247a921
get_grid_name
navidcy Mar 2, 2023
77252f3
fix typo in CubedSpherePartition
navidcy Mar 2, 2023
3526d7b
get_grid_name
navidcy Mar 2, 2023
c42dfce
remove CubedSpheres module
navidcy Mar 2, 2023
b10aca7
fix tests
navidcy Mar 3, 2023
0467c33
use MultiRegion to load cs32 grid; move test to test_multi_region_cub…
navidcy Mar 3, 2023
52e24da
add functionality to load MultiRegion ConformalCubedSphere from file
navidcy Mar 3, 2023
0cea99b
let go of CubedSpheres module
navidcy Mar 3, 2023
64a7bd7
let go of CubedSpheres module
navidcy Mar 3, 2023
6048dea
better show for OrthogonalSphericalShellGrid
navidcy Mar 3, 2023
af8c883
some code cleanup
navidcy Mar 3, 2023
c796945
drop OldConformalCubedSphereGrid
navidcy Mar 3, 2023
6197b0f
drop warning from OrthogonalSphericalShellGrid
navidcy Mar 3, 2023
818fbc7
add connectivity information in docstring
navidcy Mar 4, 2023
1fee317
add warning
navidcy Mar 4, 2023
94cd303
better docstring
navidcy Mar 4, 2023
ffa8d50
add example for how to find connectivities
navidcy Mar 4, 2023
607450f
only support equal x-y CubedSpherePartitions
navidcy Mar 4, 2023
e7263e2
add data dependencies + cleanup
navidcy Mar 4, 2023
94eadce
cleanup
navidcy Mar 4, 2023
7483c61
docstring for CubedSpherePartition
navidcy Mar 4, 2023
e1116b5
some cleanup
navidcy Mar 4, 2023
bcafe68
add util functions
navidcy Mar 4, 2023
016a408
nuke duplicate method
navidcy Mar 4, 2023
3c82df9
add getindex(::MultiRegionGrid, i)
navidcy Mar 4, 2023
6f9ffef
add CubedSphereField + export
navidcy Mar 4, 2023
58d987c
end with newline
navidcy Mar 4, 2023
cd5d038
adds return nothing to avoid ambiguity
navidcy Mar 7, 2023
73889a9
add missing comma
navidcy Mar 7, 2023
308e8ec
minor cleanup
navidcy Mar 7, 2023
8b49cdc
adds utilities for coordinate transformations on sphere
navidcy Mar 7, 2023
a91897a
extend vertices methods to work with all locations
navidcy Mar 7, 2023
041efb7
add validation + plotting example
navidcy Mar 8, 2023
3b84743
some code cleanup
navidcy Mar 8, 2023
c2f64b6
fix docstrings
navidcy Mar 8, 2023
5857e21
fix docstring
navidcy Mar 8, 2023
164140e
convert arrays to proper array type
navidcy Mar 8, 2023
f7c63dd
arch -> architecture
navidcy Mar 8, 2023
ab43b3d
allow OrthogonalSphericalShellGrid to have stretched z
navidcy Mar 8, 2023
4bdc41f
simplify
navidcy Mar 8, 2023
4b259d6
add ConformalCubedSphereGrid alias
navidcy Mar 8, 2023
277983d
add cubed_sphere_field.jl
navidcy Mar 8, 2023
d522720
better allignment
navidcy Mar 9, 2023
ae1c793
add Δzᵃᵃᶜ, Δzᵃᵃᶠ to OSSG from file
navidcy Mar 9, 2023
6d72923
alignment
navidcy Mar 9, 2023
b744b1e
define alias ZRegOrthogonalSphericalShellGrid
navidcy Mar 9, 2023
88c3cbf
fix Δz spacings for OSSG
navidcy Mar 9, 2023
150ca52
adapt Δz
navidcy Mar 9, 2023
f50ff7e
reduce parameter pressure in fill_halo
simone-silvestri Mar 9, 2023
9843928
fill flipped halos
simone-silvestri Mar 9, 2023
3d6256f
pcg for csg
simone-silvestri Mar 9, 2023
f27bb10
add with_halos
navidcy Mar 9, 2023
b6b82d4
total_size
simone-silvestri Mar 9, 2023
06c52ec
pass panel topology
navidcy Mar 9, 2023
27e89c1
make domain aware of the topology
navidcy Mar 9, 2023
3a3dcd5
apply regionally
navidcy Mar 9, 2023
3cf46b2
with_halo returns grid
navidcy Mar 9, 2023
76b92b8
updates
simone-silvestri Mar 9, 2023
4bb5d6e
Merge branch 'jmc-ss/cubed_sphere' of github.com:CliMA/Oceananigans.j…
simone-silvestri Mar 9, 2023
c482275
add ==
navidcy Mar 9, 2023
c67377b
cleanup CubedSphereConnectivity + inner constructor + docstring
navidcy Mar 14, 2023
1004d40
minor cleanup and code alignment
navidcy Mar 14, 2023
7780153
merge main
navidcy Mar 14, 2023
d21cb54
drop Suppresson
navidcy Mar 15, 2023
d50197e
create grid metrics BUT without halos
navidcy Mar 15, 2023
4af5fa3
Completely overhaul grid utils
glwagner Mar 16, 2023
4ab5bcc
no fallback for total_length
navidcy Mar 16, 2023
b9bdddd
no empty line
navidcy Mar 16, 2023
8f78c6c
fix OSSG tests
navidcy Mar 16, 2023
3007887
OSSG respect their topology + cleaner construction
navidcy Mar 16, 2023
156d395
fixes and cleanup
navidcy Mar 16, 2023
b111f18
use add_halo utility
navidcy Mar 16, 2023
bb4610c
more robust add_halos + more examples
navidcy Mar 16, 2023
bf19dd5
better show for OSSG
navidcy Mar 16, 2023
802169e
cleaner inner constructors
navidcy Mar 16, 2023
5d99a48
updates
navidcy Mar 19, 2023
780db4d
central_angle -> Distances.spherical_angle
navidcy Mar 19, 2023
ab7dee9
delete stray s
navidcy Mar 19, 2023
fb8e19f
cleaner Δx, Δy using haversine
navidcy Mar 19, 2023
2d55527
Merge branch 'main' into jmc-ss/cubed_sphere
navidcy Mar 24, 2023
f98c0af
add Distances
navidcy Mar 25, 2023
3542ce3
generalize coordinate transform utils
navidcy Mar 26, 2023
f25a3d2
remove CubedSphere module
navidcy Mar 26, 2023
48247a5
it solVes :)
navidcy Mar 26, 2023
468b95f
don't instantiate
navidcy Mar 26, 2023
1d8e887
change tabs to spaces
navidcy Mar 26, 2023
71d8278
minor cleanup
navidcy Mar 30, 2023
13e4ee6
remove spaces
navidcy Mar 30, 2023
b492146
add return nothing
navidcy Mar 30, 2023
9c1ba39
introduce Connectivity
navidcy Mar 30, 2023
e6e6e86
update ubedSphereConnectivity syntax in doctest
navidcy Mar 30, 2023
f7bd354
add getproperty methods
navidcy Mar 30, 2023
e130267
refactor CubedSphereConnectivity
navidcy Mar 30, 2023
8509416
Merge branch 'main' into jmc-ss/cubed_sphere
navidcy Mar 30, 2023
115dbb8
Oceananigans.Architecture -> Oceananigans.Architectures
navidcy Mar 30, 2023
74460fb
validate panel index function
navidcy Mar 30, 2023
5ed4cdb
allowscalar for grid equality
navidcy Mar 30, 2023
bbb4d56
add back center_str
navidcy Mar 30, 2023
708c62c
fix show(io, ::OSSG)
navidcy Mar 30, 2023
826643b
Update src/Solvers/preconditioned_conjugate_gradient_solver.jl
navidcy Mar 30, 2023
265fe41
better docs
navidcy Mar 30, 2023
ede6757
more args passing around for PCG
navidcy Mar 30, 2023
fd686a5
fix doctests
navidcy Mar 30, 2023
3dc5af6
keep the decimal
navidcy Mar 30, 2023
f8ed8a2
fill coordinates halos for cubedspheregrid
navidcy Mar 31, 2023
0754f03
fix bugs
navidcy Mar 31, 2023
18607d5
some cleanup
navidcy Apr 3, 2023
27d997a
don't allow different halo size in horizontal or different topology
navidcy Apr 3, 2023
c36a958
don't allow different halo size in horizontal or different topology
navidcy Apr 3, 2023
82d849b
don't allow different halo size in horizontal or different topology
navidcy Apr 3, 2023
0f9e9c6
merge main
navidcy Apr 6, 2023
348ffed
merge main
navidcy Apr 6, 2023
97209e5
add clarification
navidcy Apr 12, 2023
08afb95
merge main
navidcy Apr 12, 2023
1ba4055
resolve conflicts
navidcy Apr 12, 2023
f74c1dd
add Distances
navidcy Apr 12, 2023
9e700b2
fix show
navidcy Apr 13, 2023
315c002
quick fix
simone-silvestri Apr 13, 2023
4312af4
Merge branch 'jmc-ss/cubed_sphere' of github.com:CliMA/Oceananigans.j…
navidcy Apr 13, 2023
9b65290
alignment
navidcy Apr 19, 2023
7f87734
fix bug
navidcy Apr 19, 2023
796eec3
alignment
navidcy Apr 19, 2023
598c273
minor cleanup
navidcy Apr 19, 2023
9573d63
alignment
navidcy Apr 19, 2023
284622a
alignment
navidcy Apr 19, 2023
33303c8
refactor connectivity
navidcy Apr 19, 2023
387acab
merge main and resolve conflicts
navidcy Apr 19, 2023
d1320e6
resolve another conflict
navidcy Apr 19, 2023
a02f3c7
remove spaces
navidcy Apr 19, 2023
58b7267
code formatting
navidcy Apr 21, 2023
e3ef8e3
add neighbors
navidcy Apr 21, 2023
cfb4111
use λ/φnodes
navidcy Apr 26, 2023
9be8399
allowscalars
navidcy Apr 26, 2023
91c80cb
merge main
navidcy May 13, 2023
a9c3077
cleanup compact_data!
navidcy May 14, 2023
cd96e44
better doc
navidcy May 14, 2023
fc0bee5
code alignment
navidcy May 14, 2023
c14cb28
Merge branch 'main' into jmc-ss/cubed_sphere
navidcy May 14, 2023
a2a7159
cleanup, return nothings, fix docs
navidcy May 14, 2023
c4ff7b9
NonTrivialConnectivity -> NonTrivialCubedSphereConnectivity
navidcy May 15, 2023
8961cd5
fix mistake when filling both east-west or north-south halos for MCBC
navidcy May 15, 2023
2dc222f
enhance ConformalCubedSphere docstring
navidcy May 15, 2023
fc93710
upgrade test to check for proper orientation of halos
navidcy May 15, 2023
336cb53
fix doctest
navidcy May 15, 2023
886cde9
cleanup
navidcy May 15, 2023
0a51377
fix single halo filling methods
navidcy May 16, 2023
7975421
Added unit tests to check u and v halos
siddharthabishnu Jun 19, 2023
f60d616
Merge branch 'jmc-ss/cubed_sphere' of github.com:CliMA/Oceananigans.j…
navidcy Jun 21, 2023
8692a84
first implementation of u, v fill halos
simone-silvestri Jun 21, 2023
d7cecea
Merge branch 'jmc-ss/cubed_sphere' of github.com:CliMA/Oceananigans.j…
navidcy Jun 21, 2023
c62f609
simply tests
navidcy Jun 24, 2023
aebd05f
add methods for correcting halo filling for u, v
navidcy Jun 24, 2023
6d53719
Merge branch 'main' into jmc-ss/cubed_sphere
navidcy Jun 24, 2023
c2f0f8f
needs grid
navidcy Jun 25, 2023
21a38a9
begins->begin
navidcy Jun 25, 2023
b69f126
use halo filling trick for grid
navidcy Jun 26, 2023
f837287
Added a multi-region tracer advection test case
siddharthabishnu Jun 26, 2023
c45197a
fixed gpu problem
simone-silvestri Jun 26, 2023
fcbe798
small bugfix
simone-silvestri Jun 26, 2023
727a442
gpu friendlieness
simone-silvestri Jun 26, 2023
ba3604f
Merge branch 'main' into jmc-ss/cubed_sphere
simone-silvestri Jun 27, 2023
d0870e5
Created tracer advection animation on cubed sphere
siddharthabishnu Jun 27, 2023
4f698f9
fix some tests + replace_velocity_halo!
simone-silvestri Jun 27, 2023
2e50cee
Merge branch 'jmc-ss/cubed_sphere' of github.com:CliMA/Oceananigans.j…
simone-silvestri Jun 27, 2023
aebca1e
bugfix
simone-silvestri Jun 27, 2023
6372ef7
fix fallback method name
navidcy Jun 28, 2023
a9b5058
Merge branch 'main' into jmc-ss/cubed_sphere
navidcy Jun 28, 2023
58c02c2
bugfix
simone-silvestri Jun 28, 2023
33dd66f
resolve w julia v1.8.5
navidcy Jun 29, 2023
5ed7b8c
Merge branch 'main' into jmc-ss/cubed_sphere
navidcy Jun 30, 2023
7797d54
Merge branch 'main' into jmc-ss/cubed_sphere
navidcy Jul 3, 2023
dd08149
merge main
navidcy Jul 3, 2023
fff0923
unmodulify
navidcy Jul 7, 2023
bdfa370
some updates
navidcy Jul 7, 2023
97da6a7
don't inline figs
navidcy Jul 7, 2023
68a1009
Merge branch 'main' into jmc-ss/cubed_sphere
navidcy Jul 8, 2023
f3e9abc
Merge branch 'jmc-ss/cubed_sphere' of github.com:CliMA/Oceananigans.j…
navidcy Jul 8, 2023
aa7cada
add inbounds
navidcy Jul 8, 2023
56f3d8e
Modified halo checks to consider index shift
siddharthabishnu Jul 12, 2023
f16e0dd
remove stray spaces
navidcy Jul 12, 2023
3b3cb22
cleaner
navidcy Jul 12, 2023
71b7726
metaprogrammed metric halo filling, but still not right for fc, cf
navidcy Jul 12, 2023
b7ed6a6
add signed kwarg
navidcy Jul 12, 2023
c91c72c
Fixed keyword argument error
siddharthabishnu Jul 12, 2023
2124664
Condensed functions
siddharthabishnu Jul 13, 2023
09552b3
code alignment
navidcy Jul 13, 2023
b0b917c
some fixes
navidcy Jul 13, 2023
3678c7b
use default CubedSpherePartition
navidcy Jul 13, 2023
36e33ff
Merge branch 'jmc-ss/cubed_sphere' of github.com:CliMA/Oceananigans.j…
navidcy Jul 13, 2023
fe581f2
add connectivity in partition
navidcy Jul 17, 2023
2138e05
Redefined plotting functions
siddharthabishnu Jul 17, 2023
f4514fa
Removed print statement
siddharthabishnu Jul 17, 2023
b120abf
Switched panel to initialize tracer advection
siddharthabishnu Jul 17, 2023
0422512
Increased the range of Gaussian initial condition
siddharthabishnu Jul 17, 2023
561b6c9
add connectivity property in MultiRegionGrid
navidcy Jul 18, 2023
19f42e2
Merge branch 'jmc-ss/cubed_sphere' of github.com:CliMA/Oceananigans.j…
navidcy Jul 18, 2023
bddf0a8
Merge branch 'main' into jmc-ss/cubed_sphere
navidcy Jul 18, 2023
e57d5eb
Tracer advects along the equator of cubed sphere!
siddharthabishnu Jul 19, 2023
93d264c
Merge branch 'main' into jmc-ss/cubed_sphere
navidcy Jul 19, 2023
86d96ca
fix doctest
navidcy Jul 19, 2023
7a30955
clean up show methods
navidcy Jul 19, 2023
6338682
minor reorganization
navidcy Jul 19, 2023
99d84d8
add rotation in connectivity
navidcy Jul 19, 2023
cad9e2f
Prescribed zonal velocity = cosine of latitude
siddharthabishnu Jul 19, 2023
6b6fbc6
Enhanced configuration of the initial condition
siddharthabishnu Jul 19, 2023
08f0eb2
compute derivative of CubedSphereField
navidcy Jul 20, 2023
35a0e7d
Merge branch 'jmc-ss/cubed_sphere' of github.com:CliMA/Oceananigans.j…
navidcy Jul 20, 2023
eab7bc2
fixed computation on multiregion fields
simone-silvestri Jul 20, 2023
bcd7409
another try in filling velocities
navidcy Jul 20, 2023
e1dcb62
merge
navidcy Jul 20, 2023
6dbbfd1
Fixed rotation direction
siddharthabishnu Jul 20, 2023
761eb75
velocity halo filliing tests pass on a grid with 1 halo point
navidcy Jul 21, 2023
09cee1c
velocity halo filliing tests pass on a grid with ANY halo points
navidcy Jul 21, 2023
913f39f
bit of cleanup
navidcy Jul 21, 2023
8339280
Merge branch 'main' into jmc-ss/cubed_sphere
navidcy Jul 21, 2023
bbf12fe
Modified prescribed velocity for tracer advection
siddharthabishnu Jul 21, 2023
12f98cc
trying to advect a tracer
navidcy Jul 21, 2023
877c176
fill halos for coordinates
navidcy Jul 22, 2023
7a3dd91
bit of cleanup + only 2 halo fillings are required
navidcy Jul 22, 2023
571e752
more cleanup
navidcy Jul 22, 2023
a246f6d
add connectivity for X/YPartition
navidcy Jul 22, 2023
c47adda
simplify
navidcy Jul 22, 2023
0e40041
remove test-related packages
navidcy Jul 22, 2023
751eab9
cleanup
navidcy Jul 22, 2023
c224cd7
Update validation/multi_region/multi_region_tracer_advection.jl
navidcy Jul 22, 2023
2cc0246
Minor modifications
siddharthabishnu Jul 22, 2023
6c3e0b1
Update src/AbstractOperations/kernel_function_operation.jl
navidcy Jul 24, 2023
35815b2
fill halos for metrics + fix Azffa bug in OSSG
navidcy Jul 24, 2023
55e2f5c
Merge branch 'jmc-ss/cubed_sphere' of github.com:CliMA/Oceananigans.j…
navidcy Jul 24, 2023
4ccb851
2 fill halos are enough
navidcy Jul 24, 2023
71cf3f9
split tests
navidcy Jul 24, 2023
1df77cc
add test for total Az area
navidcy Jul 24, 2023
447394d
not working for R>1
navidcy Jul 24, 2023
666b292
fix typo
navidcy Jul 24, 2023
7d9255f
resolve
navidcy Jul 24, 2023
30fa1bd
fixed location(a, dim)
simone-silvestri Jul 25, 2023
ebdbb0f
Halos still not filled everywhere for face fields
siddharthabishnu Jul 25, 2023
b036a6a
Modified multi_region_cubed_sphere.jl script
siddharthabishnu Jul 25, 2023
852381a
fill velocity halos
navidcy Jul 26, 2023
a8fad05
Update src/Models/HydrostaticFreeSurfaceModels/update_hydrostatic_fre…
navidcy Jul 26, 2023
239b704
replace_horizontal_velocity_halos! only for FullyConnected OSSG
navidcy Jul 26, 2023
d3a1529
some allowscalars + 3 halo fillings
navidcy Jul 26, 2023
f98073c
convert doctests to examples
navidcy Jul 27, 2023
103cf27
fix doctests
navidcy Jul 27, 2023
7a93004
gpu friendly
navidcy Jul 27, 2023
1c6a65d
Merge branch 'jmc-ss/cubed_sphere' of github.com:CliMa/Oceananigans.j…
navidcy Jul 27, 2023
47e0719
Delete proposal.jl
navidcy Jul 27, 2023
100ffc0
Delete multi_region_cubed_sphere_derivatives.jl
navidcy Jul 27, 2023
b9c9026
Delete multi_region_tracer_advection.jl
navidcy Jul 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ steps:
architecture: CPU
depends_on: "init_cpu"

- label: "🦾 cpu distributed sovers tests"
- label: "🦾 cpu distributed solvers tests"
env:
JULIA_DEPOT_PATH: "$TARTARUS_HOME/.julia-$BUILDKITE_BUILD_NUMBER"
TEST_GROUP: "distributed_solvers"
Expand Down
14 changes: 13 additions & 1 deletion Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.9.2"
manifest_format = "2.0"
project_hash = "9044a5920a57a78e707ac7490810d9c46b9bc546"
project_hash = "ea620612cb5f84093b962d4345aa7d1b1271739c"

[[deps.AbstractFFTs]]
deps = ["LinearAlgebra"]
Expand Down Expand Up @@ -157,6 +157,12 @@ version = "1.0.0"
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"

[[deps.Distances]]
deps = ["LinearAlgebra", "SparseArrays", "Statistics", "StatsAPI"]
git-tree-sha1 = "49eba9ad9f7ead780bfb7ee319f962c811c6d3b2"
uuid = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
version = "0.10.8"

[[deps.Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Expand Down Expand Up @@ -676,6 +682,12 @@ deps = ["LinearAlgebra", "SparseArrays"]
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
version = "1.9.0"

[[deps.StatsAPI]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "45a7769a04a3cf80da1c1c7c60caf932e6f4c9f7"
uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0"
version = "1.6.0"

[[deps.Strided]]
deps = ["LinearAlgebra", "StridedViews", "TupleTools"]
git-tree-sha1 = "b32eadf6ac726a790567fdc872b63117712e16a8"
Expand Down
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
Crayons = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
CubedSphere = "7445602f-e544-4518-8976-18f8e8ae6cdb"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
Glob = "c27321d9-0574-5035-807b-f59d2c89b15c"
Expand Down Expand Up @@ -39,6 +40,7 @@ Adapt = "3"
CUDA = "4"
Crayons = "4"
CubedSphere = "0.1, 0.2"
Distances = "0.10"
DocStringExtensions = "0.8, 0.9"
FFTW = "1"
Glob = "1.3"
Expand Down
40 changes: 22 additions & 18 deletions docs/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ version = "0.9.3"

[[deps.Documenter]]
deps = ["ANSIColoredPrinters", "Base64", "Dates", "DocStringExtensions", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"]
git-tree-sha1 = "58fea7c536acd71f3eef6be3b21c0df5f3df88fd"
git-tree-sha1 = "39fd748a73dce4c05a9655475e437170d8fb1b67"
uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
version = "0.27.24"
version = "0.27.25"

[[deps.DocumenterCitations]]
deps = ["Bibliography", "DataStructures", "Documenter", "Markdown", "Unicode"]
Expand Down Expand Up @@ -355,9 +355,9 @@ uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"

[[deps.FillArrays]]
deps = ["LinearAlgebra", "Random", "SparseArrays", "Statistics"]
git-tree-sha1 = "0b3b52afd0f87b0a3f5ada0466352d125c9db458"
git-tree-sha1 = "2250347838b28a108d1967663cba57bfb3c02a58"
uuid = "1a297f60-69ca-5386-bcde-b61e274b549b"
version = "1.2.1"
version = "1.3.0"

[[deps.FixedPointNumbers]]
deps = ["Statistics"]
Expand Down Expand Up @@ -876,9 +876,9 @@ version = "0.5.4"

[[deps.OffsetArrays]]
deps = ["Adapt"]
git-tree-sha1 = "82d7c9e310fe55aa54996e6f7f94674e2a38fcb4"
git-tree-sha1 = "2ac17d29c523ce1cd38e27785a7d23024853a4bb"
uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
version = "1.12.9"
version = "1.12.10"

[[deps.Ogg_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
Expand Down Expand Up @@ -1232,10 +1232,14 @@ uuid = "cae243ae-269e-4f55-b966-ac2d0dc13c15"
version = "0.1.1"

[[deps.StaticArrays]]
deps = ["LinearAlgebra", "Random", "StaticArraysCore", "Statistics"]
git-tree-sha1 = "832afbae2a45b4ae7e831f86965469a24d1d8a83"
deps = ["LinearAlgebra", "Random", "StaticArraysCore"]
git-tree-sha1 = "0da7e6b70d1bb40b1ace3b576da9ea2992f76318"
uuid = "90137ffa-7385-5640-81b9-e52037218182"
version = "1.5.26"
version = "1.6.0"
weakdeps = ["Statistics"]

[deps.StaticArrays.extensions]
StaticArraysStatisticsExt = "Statistics"

[[deps.StaticArraysCore]]
git-tree-sha1 = "6b7ba252635a5eff6a0b0664a41ee140a1c9e72a"
Expand Down Expand Up @@ -1397,16 +1401,16 @@ uuid = "aed1982a-8fda-507f-9586-7b0439959a61"
version = "1.1.34+0"

[[deps.Xorg_libX11_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxcb_jll", "Xorg_xtrans_jll"]
git-tree-sha1 = "5be649d550f3f4b95308bf0183b82e2582876527"
deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libxcb_jll", "Xorg_xtrans_jll"]
git-tree-sha1 = "afead5aba5aa507ad5a3bf01f58f82c8d1403495"
uuid = "4f6342f7-b3d2-589e-9d20-edeb45f2b2bc"
version = "1.6.9+4"
version = "1.8.6+0"

[[deps.Xorg_libXau_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "4e490d5c960c314f33885790ed410ff3a94ce67e"
deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "6035850dcc70518ca32f012e46015b9beeda49d8"
uuid = "0c0b7dd1-d40b-584c-a123-a41640f87eec"
version = "1.0.9+4"
version = "1.0.11+0"

[[deps.Xorg_libXdmcp_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
Expand All @@ -1433,10 +1437,10 @@ uuid = "14d82f49-176c-5ed1-bb49-ad3f5cbd8c74"
version = "0.1.1+0"

[[deps.Xorg_libxcb_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "XSLT_jll", "Xorg_libXau_jll", "Xorg_libXdmcp_jll", "Xorg_libpthread_stubs_jll"]
git-tree-sha1 = "daf17f441228e7a3833846cd048892861cff16d6"
deps = ["Artifacts", "JLLWrappers", "Libdl", "XSLT_jll", "Xorg_libXau_jll", "Xorg_libXdmcp_jll", "Xorg_libpthread_stubs_jll"]
git-tree-sha1 = "b4bfde5d5b652e22b9c790ad00af08b6d042b97d"
uuid = "c7cfdc94-dc32-55de-ac96-5a1b8d977c5b"
version = "1.13.0+3"
version = "1.15.0+0"

[[deps.Xorg_xtrans_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
Expand Down
90 changes: 55 additions & 35 deletions src/AbstractOperations/at.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,52 +58,72 @@ indices(f::Function) = default_indices(3)
indices(f::Number) = default_indices(3)

"""
interpolate_indices(operands..., loc_operation = abstract_operation_location)
intersect_indices(loc, operands...)

Utility to propagate operands' indices in `AbstractOperations`s with multiple operands
(`BinaryOperation`s and `MultiaryOperation`s).
Utility to compute the intersection of `operands' indices.
"""
function interpolate_indices(args...; loc_operation = (Center, Center, Center))
idxs = Any[:, :, :]
for i in 1:3
for arg in args
idxs[i] = interpolate_index(indices(arg)[i], idxs[i], location(arg)[i], loc_operation[i])
end
end
function intersect_indices(loc, operands...)

return Tuple(idxs)
idx1 = compute_index_intersection(Colon(), loc[1], operands...; dim=1)
idx2 = compute_index_intersection(Colon(), loc[2], operands...; dim=2)
idx3 = compute_index_intersection(Colon(), loc[3], operands...; dim=3)

return (idx1, idx2, idx3)
end

interpolate_index(::Colon, ::Colon, args...) = Colon()
interpolate_index(::Colon, b::UnitRange, args...) = b

instantiate(T::Type) = T()
instantiate(t) = t
# Fallback for `KernelFunctionOperation`s with no argument
compute_index_intersection(::Colon, to_loc; kw...) = Colon()

function interpolate_index(a::UnitRange, ::Colon, loc, new_loc)
a = corrected_index(a, instantiate(loc), instantiate(new_loc))
compute_index_intersection(to_idx, to_loc, op; dim) =
_compute_index_intersection(to_idx, indices(op)[dim],
to_loc, location(op, dim))

# Abstract operations that require an interpolation of a sliced fields are not supported!
first(a) > last(a) && throw(ArgumentError("Cannot interpolate a sliced field from $loc to $(new_loc)!"))
return a
"""Compute index intersection recursively for `dim`ension ∈ (1, 2, 3)."""
function compute_index_intersection(to_idx, to_loc, op1, op2, more_ops...; dim)
new_to_idx = _compute_index_intersection(to_idx, indices(op1)[dim], to_loc, location(op1, dim))
return compute_index_intersection(new_to_idx, to_loc, op2, more_ops...; dim)
end

function interpolate_index(a::UnitRange, b::UnitRange, loc, new_loc)
a = corrected_index(a, instantiate(loc), instantiate(new_loc))
# Life is pretty simple in this case.
_compute_index_intersection(to_idx::Colon, from_idx::Colon, args...) = Colon()

# Because `from_idx` imposes no restrictions, we just return `to_idx`.
_compute_index_intersection(to_idx::UnitRange, from_idx::Colon, args...) = to_idx

# Abstract operations that require an interpolation of a sliced fields are not supported!
first(a) > last(a) && throw(ArgumentError("Cannot interpolate a sliced field from $loc to $(new_loc)!"))
# This time we account for the possible range-reducing effect of interpolation on `from_idx`.
function _compute_index_intersection(to_idx::Colon, from_idx::UnitRange, to_loc, from_loc)
shifted_idx = restrict_index_for_interpolation(from_idx, from_loc, to_loc)
validate_shifted_index(shifted_idx)
return shifted_idx
end

# Compute the intersection of two index ranges
function _compute_index_intersection(to_idx::UnitRange, from_idx::UnitRange, to_loc, from_loc)
shifted_idx = restrict_index_for_interpolation(from_idx, from_loc, to_loc)
validate_shifted_index(shifted_idx)

indices = UnitRange(max(first(a), first(b)), min(last(a), last(b)))
range_intersection = UnitRange(max(first(shifted_idx), first(to_idx)), min(last(shifted_idx), last(to_idx)))

# Abstract operations between parallel non-intersecating windowed fields are not supported
first(indices) > last(indices) && throw(ArgumentError("BinaryOperation operand indices $(a) and $(b) do not intersect!"))
return indices
# Check validity of the intersection index range
first(range_intersection) > last(range_intersection) &&
throw(ArgumentError("Indices $(from_idx) and $(to_idx) interpolated from $(from_loc) to $(to_loc) do not intersect!"))

return range_intersection
end

# Windowed fields interpolated from `Center`s to `Face`s lose the first index.
# Viceverse, windowed fields interpolated from `Face`s to `Center`s lose the last index
corrected_index(a, ::Face, ::Face) = UnitRange(first(a), last(a) )
corrected_index(a, ::Center, ::Center) = UnitRange(first(a), last(a) )
corrected_index(a, ::Face, ::Center) = UnitRange(first(a), last(a)-1)
corrected_index(a, ::Center, ::Face) = UnitRange(first(a)+1, last(a) )
validate_shifted_index(shifted_idx) = first(shifted_idx) > last(shifted_idx) &&
throw(ArgumentError("Cannot compute index intersection for indices $(from_idx) interpolating from $(from_loc) to $(to_loc)!"))

"""
restrict_index_for_interpolation(from_idx, from_loc, to_loc)

Return a "restricted" index range for the result of interpolating from
`from_loc` to `to_loc`, over the index range `from_idx`:

* Windowed fields interpolated from `Center`s to `Face`s lose the first index.
* Conversely, windowed fields interpolated from `Face`s to `Center`s lose the last index
"""
restrict_index_for_interpolation(from_idx, ::Type{Face}, ::Type{Face}) = UnitRange(first(from_idx), last(from_idx))
restrict_index_for_interpolation(from_idx, ::Type{Center}, ::Type{Center}) = UnitRange(first(from_idx), last(from_idx))
restrict_index_for_interpolation(from_idx, ::Type{Face}, ::Type{Center}) = UnitRange(first(from_idx), last(from_idx)-1)
restrict_index_for_interpolation(from_idx, ::Type{Center}, ::Type{Face}) = UnitRange(first(from_idx)+1, last(from_idx))
2 changes: 1 addition & 1 deletion src/AbstractOperations/binary_operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ end
# Recompute location of binary operation
@inline at(loc, β::BinaryOperation) = β.op(loc, at(loc, β.a), at(loc, β.b))

indices(β::BinaryOperation) = interpolate_indices(β.a, β.b; loc_operation = location(β))
indices(β::BinaryOperation) = construct_regionally(intersect_indices, location(β), β.a, β.b)

"""Create a binary operation for `op` acting on `a` and `b` at `Lc`, where
`a` and `b` have location `La` and `Lb`."""
Expand Down
4 changes: 2 additions & 2 deletions src/AbstractOperations/computed_field.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function Field(operand::AbstractOperation;
loc = location(operand)
indices = validate_indices(indices, loc, grid)

boundary_conditions = FieldBoundaryConditions(indices, boundary_conditions)
@apply_regionally boundary_conditions = FieldBoundaryConditions(indices, boundary_conditions)

if isnothing(data)
data = new_data(grid, loc, indices)
Expand All @@ -63,7 +63,7 @@ Compute `comp.operand` and store the result in `comp.data`.
"""
function compute!(comp::ComputedField, time=nothing)
# First compute `dependencies`:
@apply_regionally compute_at!(comp.operand, time)
compute_at!(comp.operand, time)

# Now perform the primary computation
@apply_regionally compute_computed_field!(comp)
Expand Down
8 changes: 4 additions & 4 deletions src/AbstractOperations/conditional_operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ struct ConditionalOperation{LX, LY, LZ, O, F, G, C, M, T} <: AbstractOperation{L
condition :: C
mask :: M

function ConditionalOperation{LX, LY, LZ}(operand::O, func::F, grid::G, condition::C, mask::M) where {LX, LY, LZ, O, F, G, C, M}
T = eltype(operand)
return new{LX, LY, LZ, O, F, G, C, M, T}(operand, func, grid, condition, mask)
end
function ConditionalOperation{LX, LY, LZ}(operand::O, func::F, grid::G, condition::C, mask::M) where {LX, LY, LZ, O, F, G, C, M}
T = eltype(operand)
return new{LX, LY, LZ, O, F, G, C, M, T}(operand, func, grid, condition, mask)
end
end

"""
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractOperations/kernel_function_operation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct KernelFunctionOperation{LX, LY, LZ, G, T, K, D} <: AbstractOperation{LX,
end

@inline Base.getindex(κ::KernelFunctionOperation, i, j, k) = κ.kernel_function(i, j, k, κ.grid, κ.arguments...)
indices(κ::KernelFunctionOperation) = interpolate_indices(κ.arguments...; loc_operation = location(κ))
indices(κ::KernelFunctionOperation) = construct_regionally(intersect_indices, location(κ), κ.arguments...)
compute_at!(κ::KernelFunctionOperation, time) = Tuple(compute_at!(d, time) for d in κ.arguments)

"Adapt `KernelFunctionOperation` to work on the GPU via CUDAnative and CUDAdrv."
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractOperations/multiary_operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ end
##### MultiaryOperation construction
#####

indices(Π::MultiaryOperation) = interpolate_indices(Π.args...; loc_operation = location(Π))
indices(Π::MultiaryOperation) = construct_regionally(intersect_indices, location(Π), Π.args...)

function _multiary_operation(L, op, args, Largs, grid)
▶ = Tuple(interpolation_operator(La, L) for La in Largs)
Expand Down
2 changes: 1 addition & 1 deletion src/Advection/weno_interpolants.jl
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ julia> calc_weno_stencil(2, :right, :x)
dir == :y ?
:(@inbounds ψ(i, j + $c, k, args...)) :
:(@inbounds ψ(i, j, k + $c, args...))
else
else
stencil_point[idx] = dir == :x ?
:(@inbounds ψ[i + $c, j, k]) :
dir == :y ?
Expand Down
4 changes: 2 additions & 2 deletions src/BoundaryConditions/boundary_condition.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ const OBC = BoundaryCondition{<:Open}
const VBC = BoundaryCondition{<:Value}
const GBC = BoundaryCondition{<:Gradient}
const ZFBC = BoundaryCondition{Flux, Nothing} # "zero" flux
const MCBC = BoundaryCondition{<:MultiRegionCommunication}
const DCBC = BoundaryCondition{<:DistributedCommunication}
const MCBC = BoundaryCondition{<:MultiRegionCommunication}
const DCBC = BoundaryCondition{<:DistributedCommunication}

# More readable BC constructors for the public API.
PeriodicBoundaryCondition() = BoundaryCondition(Periodic, nothing)
Expand Down
Loading