From eb7c1781bfeea6b4f5d2c5931c999b3d75f78464 Mon Sep 17 00:00:00 2001 From: Simone Silvestri Date: Tue, 23 Jul 2024 18:02:08 -0400 Subject: [PATCH] Removing some advection schemes (#3659) * removing methods * another method removed * last change * try updating manifest --- Manifest.toml | 156 ++++++++++-------- src/Advection/Advection.jl | 1 - src/Advection/vector_invariant_advection.jl | 1 - src/Advection/vector_invariant_upwinding.jl | 26 --- .../vector_invariant_velocity_upwinding.jl | 97 ----------- src/Advection/weno_interpolants.jl | 29 +--- src/Advection/weno_reconstruction.jl | 69 ++++---- 7 files changed, 120 insertions(+), 259 deletions(-) delete mode 100644 src/Advection/vector_invariant_velocity_upwinding.jl diff --git a/Manifest.toml b/Manifest.toml index e6430083f4..ac46b1775a 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -1,6 +1,6 @@ # This file is machine-generated - editing it directly is not advised -julia_version = "1.10.0" +julia_version = "1.10.4" manifest_format = "2.0" project_hash = "8d5da80dd05814164ee23c791edd5549b032a426" @@ -34,9 +34,9 @@ version = "1.1.1" [[deps.ArrayInterface]] deps = ["Adapt", "LinearAlgebra", "SparseArrays", "SuiteSparse"] -git-tree-sha1 = "133a240faec6e074e07c31ee75619c90544179cf" +git-tree-sha1 = "5c9b74c973181571deb6442d41e5c902e6b9f38e" uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" -version = "7.10.0" +version = "7.12.0" [deps.ArrayInterface.extensions] ArrayInterfaceBandedMatricesExt = "BandedMatrices" @@ -103,9 +103,9 @@ version = "0.1.3" [[deps.CUDA]] deps = ["AbstractFFTs", "Adapt", "BFloat16s", "CEnum", "CUDA_Driver_jll", "CUDA_Runtime_Discovery", "CUDA_Runtime_jll", "Crayons", "DataFrames", "ExprTools", "GPUArrays", "GPUCompiler", "KernelAbstractions", "LLVM", "LLVMLoopInfo", "LazyArtifacts", "Libdl", "LinearAlgebra", "Logging", "NVTX", "Preferences", "PrettyTables", "Printf", "Random", "Random123", "RandomNumbers", "Reexport", "Requires", "SparseArrays", "StaticArrays", "Statistics"] -git-tree-sha1 = "6e945e876652f2003e6ca74e19a3c45017d3e9f6" +git-tree-sha1 = "fdd9dfb67dfefd548f51000cc400bb51003de247" uuid = "052768ef-5323-5732-b1bb-66c8b64840ba" -version = "5.4.2" +version = "5.4.3" [deps.CUDA.extensions] ChainRulesCoreExt = "ChainRulesCore" @@ -119,21 +119,21 @@ version = "5.4.2" [[deps.CUDA_Driver_jll]] deps = ["Artifacts", "JLLWrappers", "LazyArtifacts", "Libdl", "Pkg"] -git-tree-sha1 = "c48f9da18efd43b6b7adb7ee1f93fe5f2926c339" +git-tree-sha1 = "97df9d4d6be8ac6270cb8fd3b8fc413690820cbd" uuid = "4ee394cb-3365-5eb0-8335-949819d2adfc" -version = "0.9.0+0" +version = "0.9.1+1" [[deps.CUDA_Runtime_Discovery]] deps = ["Libdl"] -git-tree-sha1 = "5db9da5fdeaa708c22ba86b82c49528f402497f2" +git-tree-sha1 = "f3b237289a5a77c759b2dd5d4c2ff641d67c4030" uuid = "1af6417a-86b4-443c-805f-a4643ffb695f" -version = "0.3.3" +version = "0.3.4" [[deps.CUDA_Runtime_jll]] deps = ["Artifacts", "CUDA_Driver_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "TOML"] -git-tree-sha1 = "bcba305388e16aa5c879e896726db9e71b4942c6" +git-tree-sha1 = "afea94249b821dc754a8ca6695d3daed851e1f5a" uuid = "76a88914-d11a-5bdc-97e0-2f5a05c973a2" -version = "0.14.0+1" +version = "0.14.1+0" [[deps.ColorTypes]] deps = ["FixedPointNumbers", "Random"] @@ -153,6 +153,11 @@ git-tree-sha1 = "d6fb5bf939a2753c74984b11434ea25d6c397a58" uuid = "1fbeeb36-5f17-413c-809b-666fb144f157" version = "0.3.6" +[[deps.CommonWorldInvalidations]] +git-tree-sha1 = "ae52d1c52048455e85a387fbee9be553ec2b68d0" +uuid = "f70d9fcc-98c5-4d4a-abd7-e4cdeebd8ca8" +version = "1.0.0" + [[deps.Compat]] deps = ["TOML", "UUIDs"] git-tree-sha1 = "b1c55339b7c6c350ee89f2c1604299660525b248" @@ -166,13 +171,13 @@ weakdeps = ["Dates", "LinearAlgebra"] [[deps.CompilerSupportLibraries_jll]] deps = ["Artifacts", "Libdl"] uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" -version = "1.0.5+1" +version = "1.1.1+0" [[deps.ConstructionBase]] deps = ["LinearAlgebra"] -git-tree-sha1 = "260fd2400ed2dab602a7c15cf10c1933c59930a2" +git-tree-sha1 = "d8a9c0b6ac2d9081bf76324b39c78ca3ce4f0c98" uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9" -version = "1.5.5" +version = "1.5.6" [deps.ConstructionBase.extensions] ConstructionBaseIntervalSetsExt = "IntervalSets" @@ -302,9 +307,9 @@ version = "6.2.1+6" [[deps.GPUArrays]] deps = ["Adapt", "GPUArraysCore", "LLVM", "LinearAlgebra", "Printf", "Random", "Reexport", "Serialization", "Statistics"] -git-tree-sha1 = "38cb19b8a3e600e509dc36a6396ac74266d108c1" +git-tree-sha1 = "a74c3f1cf56a3dfcdef0605f8cdb7015926aae30" uuid = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7" -version = "10.1.1" +version = "10.3.0" [[deps.GPUArraysCore]] deps = ["Adapt"] @@ -313,10 +318,10 @@ uuid = "46192b85-c4d5-4398-a991-12ede77f4527" version = "0.1.6" [[deps.GPUCompiler]] -deps = ["ExprTools", "InteractiveUtils", "LLVM", "Libdl", "Logging", "Scratch", "TimerOutputs", "UUIDs"] -git-tree-sha1 = "518ebd058c9895de468a8c255797b0c53fdb44dd" +deps = ["ExprTools", "InteractiveUtils", "LLVM", "Libdl", "Logging", "Preferences", "Scratch", "Serialization", "TOML", "TimerOutputs", "UUIDs"] +git-tree-sha1 = "ab29216184312f99ff957b32cd63c2fe9c928b91" uuid = "61eb1bfa-7361-4325-ad38-22787b887f55" -version = "0.26.5" +version = "0.26.7" [[deps.Glob]] git-tree-sha1 = "97285bbd5230dd766e9ef6749b80fc617126d496" @@ -337,9 +342,9 @@ version = "1.14.3+3" [[deps.Hwloc_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "ca0f6bf568b4bfc807e7537f081c81e35ceca114" +git-tree-sha1 = "5e19e1e4fa3e71b774ce746274364aef0234634e" uuid = "e33a78d0-f292-5ffc-b300-72abe9b543c8" -version = "2.10.0+0" +version = "2.11.1+0" [[deps.IfElse]] git-tree-sha1 = "debdd00ffef04665ccbb3e150747a77560e8fad1" @@ -353,16 +358,23 @@ uuid = "40713840-3770-5561-ab4c-a76e7d0d7895" version = "0.2.1" [[deps.InlineStrings]] -deps = ["Parsers"] -git-tree-sha1 = "9cc2baf75c6d09f9da536ddf58eb2f29dedaf461" +git-tree-sha1 = "45521d31238e87ee9f9732561bfee12d4eebd52d" uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48" -version = "1.4.0" +version = "1.4.2" + + [deps.InlineStrings.extensions] + ArrowTypesExt = "ArrowTypes" + ParsersExt = "Parsers" + + [deps.InlineStrings.weakdeps] + ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd" + Parsers = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" [[deps.IntelOpenMP_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "be50fe8df3acbffa0274a744f1a99d29c45a57f4" +git-tree-sha1 = "14eb2b542e748570b56446f4c50fbfb2306ebc45" uuid = "1d5cc7b8-4909-519e-a0f8-d0f5ad9712d0" -version = "2024.1.0+0" +version = "2024.2.0+0" [[deps.InteractiveUtils]] deps = ["Markdown"] @@ -391,9 +403,9 @@ version = "1.0.0" [[deps.JLD2]] deps = ["FileIO", "MacroTools", "Mmap", "OrderedCollections", "Pkg", "PrecompileTools", "Reexport", "Requires", "TranscodingStreams", "UUIDs", "Unicode"] -git-tree-sha1 = "bdbe8222d2f5703ad6a7019277d149ec6d78c301" +git-tree-sha1 = "5fe858cb863e211c6dedc8cce2dc0752d4ab6e2b" uuid = "033835bb-8acc-5ee8-8aae-3f567f8a3819" -version = "0.4.48" +version = "0.4.50" [[deps.JLLWrappers]] deps = ["Artifacts", "Preferences"] @@ -433,9 +445,9 @@ version = "0.9.22" [[deps.LLVM]] deps = ["CEnum", "LLVMExtra_jll", "Libdl", "Preferences", "Printf", "Requires", "Unicode"] -git-tree-sha1 = "065c36f95709dd4a676dc6839a35d6fa6f192f24" +git-tree-sha1 = "020abd49586480c1be84f57da0017b5d3db73f7c" uuid = "929cbde3-209d-540e-8aea-75f648917ca0" -version = "7.1.0" +version = "8.0.0" weakdeps = ["BFloat16s"] [deps.LLVM.extensions] @@ -443,9 +455,9 @@ weakdeps = ["BFloat16s"] [[deps.LLVMExtra_jll]] deps = ["Artifacts", "JLLWrappers", "LazyArtifacts", "Libdl", "TOML"] -git-tree-sha1 = "88b916503aac4fb7f701bb625cd84ca5dd1677bc" +git-tree-sha1 = "c2636c264861edc6d305e6b4d528f09566d24c5e" uuid = "dad2f222-ce93-54a1-a47d-0025e8a3acab" -version = "0.0.29+0" +version = "0.0.30+0" [[deps.LLVMLoopInfo]] git-tree-sha1 = "2e5c102cfc41f48ae4740c7eca7743cc7e7b75ea" @@ -509,9 +521,9 @@ uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" [[deps.LogExpFunctions]] deps = ["DocStringExtensions", "IrrationalConstants", "LinearAlgebra"] -git-tree-sha1 = "18144f3e9cbe9b15b070288eef858f71b291ce37" +git-tree-sha1 = "a2d09619db4e765091ee5c6ffe8872849de0feea" uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" -version = "0.3.27" +version = "0.3.28" [deps.LogExpFunctions.extensions] LogExpFunctionsChainRulesCoreExt = "ChainRulesCore" @@ -534,15 +546,15 @@ version = "1.9.4+0" [[deps.MKL_jll]] deps = ["Artifacts", "IntelOpenMP_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "oneTBB_jll"] -git-tree-sha1 = "80b2833b56d466b3858d565adcd16a4a05f2089b" +git-tree-sha1 = "f046ccd0c6db2832a9f639e2c669c6fe867e5f4f" uuid = "856f044c-d86e-5d09-b602-aeab76dc8ba7" -version = "2024.1.0+0" +version = "2024.2.0+0" [[deps.MPI]] deps = ["Distributed", "DocStringExtensions", "Libdl", "MPICH_jll", "MPIPreferences", "MPItrampoline_jll", "MicrosoftMPI_jll", "OpenMPI_jll", "PkgVersion", "PrecompileTools", "Requires", "Serialization", "Sockets"] -git-tree-sha1 = "4e3136db3735924f96632a5b40a5979f1f53fa07" +git-tree-sha1 = "14cef41baf5b675b192b02a22c710f725ab333a7" uuid = "da04e1cc-30fd-572f-bb4f-1f8673147195" -version = "0.20.19" +version = "0.20.20" [deps.MPI.extensions] AMDGPUExt = "AMDGPU" @@ -554,9 +566,9 @@ version = "0.20.19" [[deps.MPICH_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Hwloc_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML"] -git-tree-sha1 = "4099bb6809ac109bfc17d521dad33763bcf026b7" +git-tree-sha1 = "19d4bd098928a3263693991500d05d74dbdc2004" uuid = "7cb0a576-ebde-5e09-9194-50597f1243b4" -version = "4.2.1+1" +version = "4.2.2+0" [[deps.MPIPreferences]] deps = ["Libdl", "Preferences"] @@ -639,9 +651,9 @@ uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" version = "1.2.0" [[deps.OffsetArrays]] -git-tree-sha1 = "e64b4f5ea6b7389f6f046d13d4896a8f9c1ba71e" +git-tree-sha1 = "1a27764e945a152f7ca7efa04de513d473e9542e" uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" -version = "1.14.0" +version = "1.14.1" weakdeps = ["Adapt"] [deps.OffsetArrays.extensions] @@ -650,7 +662,7 @@ weakdeps = ["Adapt"] [[deps.OpenBLAS_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" -version = "0.3.23+2" +version = "0.3.23+4" [[deps.OpenLibm_jll]] deps = ["Artifacts", "Libdl"] @@ -665,9 +677,9 @@ version = "4.1.6+0" [[deps.OpenSSL_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "3da7367955dcc5c54c1ba4d402ccdc09a1a3e046" +git-tree-sha1 = "a028ee3cb5641cccc4c24e90c36b0a4f7707bdf5" uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" -version = "3.0.13+1" +version = "3.0.14+0" [[deps.OpenSpecFun_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] @@ -700,15 +712,17 @@ version = "2.8.1" [[deps.PencilArrays]] deps = ["Adapt", "JSON3", "LinearAlgebra", "MPI", "OffsetArrays", "Random", "Reexport", "StaticArrayInterface", "StaticArrays", "StaticPermutations", "Strided", "TimerOutputs", "VersionParsing"] -git-tree-sha1 = "6510e851700a851944f7ffa5cd990cced4802ad2" +git-tree-sha1 = "fa85ac32172d96cfdb91dbc53e8e57007e5a2b5a" uuid = "0e08944d-e94e-41b1-9406-dcf66b6a9d2e" -version = "0.19.3" +version = "0.19.5" [deps.PencilArrays.extensions] + PencilArraysAMDGPUExt = ["AMDGPU"] PencilArraysDiffEqExt = ["DiffEqBase"] PencilArraysHDF5Ext = ["HDF5"] [deps.PencilArrays.weakdeps] + AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e" DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" @@ -839,9 +853,9 @@ version = "0.3.4" [[deps.SentinelArrays]] deps = ["Dates", "Random"] -git-tree-sha1 = "90b4f68892337554d31cdcdbe19e48989f26c7e6" +git-tree-sha1 = "ff11acffdb082493657550959d4feb4b6149e73a" uuid = "91c51154-3ec4-41a3-a24f-3f23e20d615c" -version = "1.4.3" +version = "1.4.5" [[deps.Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" @@ -873,16 +887,16 @@ version = "2.4.0" ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" [[deps.Static]] -deps = ["IfElse"] -git-tree-sha1 = "d2fdac9ff3906e27f7a618d47b676941baa6c80c" +deps = ["CommonWorldInvalidations", "IfElse", "PrecompileTools"] +git-tree-sha1 = "87d51a3ee9a4b0d2fe054bdd3fc2436258db2603" uuid = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" -version = "0.8.10" +version = "1.1.1" [[deps.StaticArrayInterface]] deps = ["ArrayInterface", "Compat", "IfElse", "LinearAlgebra", "PrecompileTools", "Requires", "SparseArrays", "Static", "SuiteSparse"] -git-tree-sha1 = "5d66818a39bb04bf328e92bc933ec5b4ee88e436" +git-tree-sha1 = "8963e5a083c837531298fc41599182a759a87a6d" uuid = "0d7ed370-da01-4f52-bd93-41d350b8b718" -version = "1.5.0" +version = "1.5.1" weakdeps = ["OffsetArrays", "StaticArrays"] [deps.StaticArrayInterface.extensions] @@ -891,9 +905,9 @@ weakdeps = ["OffsetArrays", "StaticArrays"] [[deps.StaticArrays]] deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"] -git-tree-sha1 = "9ae599cd7529cfce7fea36cf00a62cfc56f0f37c" +git-tree-sha1 = "eeafab08ae20c62c44c8399ccb9354a04b80db50" uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.9.4" +version = "1.9.7" [deps.StaticArrays.extensions] StaticArraysChainRulesCoreExt = "ChainRulesCore" @@ -904,9 +918,9 @@ version = "1.9.4" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" [[deps.StaticArraysCore]] -git-tree-sha1 = "36b3d696ce6366023a0ea192b4cd442268995a0d" +git-tree-sha1 = "192954ef1208c7019899fbf8049e717f92959682" uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" -version = "1.4.2" +version = "1.4.3" [[deps.StaticPermutations]] git-tree-sha1 = "193c3daa18ff3e55c1dae66acb6a762c4a3bdb0b" @@ -926,15 +940,15 @@ version = "1.7.0" [[deps.Strided]] deps = ["LinearAlgebra", "StridedViews", "TupleTools"] -git-tree-sha1 = "40c69be0e1b72ee2f42923b7d1ff13e0b04e675c" +git-tree-sha1 = "bd9bd1c70cfc115cc3a30213fc725125a6b43652" uuid = "5e0ebb24-38b0-5f93-81fe-25c709ecae67" -version = "2.0.4" +version = "2.1.0" [[deps.StridedViews]] deps = ["LinearAlgebra", "PackageExtensionCompat"] -git-tree-sha1 = "5b765c4e401693ab08981989f74a36a010aa1d8e" +git-tree-sha1 = "2917996ce0fa6b8a3a85240a5e9ff930e2aeaa43" uuid = "4db3bf67-4bd7-4b4e-b153-31dc3fb37143" -version = "0.2.2" +version = "0.3.1" weakdeps = ["CUDA"] [deps.StridedViews.extensions] @@ -986,10 +1000,10 @@ uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" version = "1.0.1" [[deps.Tables]] -deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits"] -git-tree-sha1 = "cb76cf677714c095e535e3501ac7954732aeea2d" +deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "OrderedCollections", "TableTraits"] +git-tree-sha1 = "598cd7c1f68d1e205689b1c2fe65a9f85846f297" uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" -version = "1.11.1" +version = "1.12.0" [[deps.Tar]] deps = ["ArgTools", "SHA"] @@ -1019,9 +1033,9 @@ uuid = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f" version = "0.5.24" [[deps.TranscodingStreams]] -git-tree-sha1 = "5d54d076465da49d6746c647022f3b3674e64156" +git-tree-sha1 = "96612ac5365777520c3c5396314c8cf7408f436a" uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" -version = "0.10.8" +version = "0.11.1" weakdeps = ["Random", "Test"] [deps.TranscodingStreams.extensions] @@ -1046,9 +1060,9 @@ version = "0.2.1" [[deps.UnsafeAtomicsLLVM]] deps = ["LLVM", "UnsafeAtomics"] -git-tree-sha1 = "d9f5962fecd5ccece07db1ff006fb0b5271bdfdd" +git-tree-sha1 = "bf2c553f25e954a9b38c9c0593a59bb13113f9e5" uuid = "d80eeb9a-aca5-4d75-85e5-170c8b632249" -version = "0.1.4" +version = "0.1.5" [[deps.VersionParsing]] git-tree-sha1 = "58d6e80b4ee071f5efd07fda82cb9fbe17200868" @@ -1057,9 +1071,9 @@ version = "1.3.0" [[deps.XML2_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Zlib_jll"] -git-tree-sha1 = "52ff2af32e591541550bd753c0da8b9bc92bb9d9" +git-tree-sha1 = "d9717ce3518dc68a99e6b96300813760d887a01d" uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a" -version = "2.12.7+0" +version = "2.13.1+0" [[deps.XZ_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] diff --git a/src/Advection/Advection.jl b/src/Advection/Advection.jl index b8d7d96469..dffd8daaba 100644 --- a/src/Advection/Advection.jl +++ b/src/Advection/Advection.jl @@ -71,7 +71,6 @@ include("vector_invariant_upwinding.jl") include("vector_invariant_advection.jl") include("vector_invariant_cross_upwinding.jl") include("vector_invariant_self_upwinding.jl") -include("vector_invariant_velocity_upwinding.jl") include("flat_advective_fluxes.jl") include("topologically_conditional_interpolation.jl") diff --git a/src/Advection/vector_invariant_advection.jl b/src/Advection/vector_invariant_advection.jl index 537dcf6eb3..59d3c32322 100644 --- a/src/Advection/vector_invariant_advection.jl +++ b/src/Advection/vector_invariant_advection.jl @@ -147,7 +147,6 @@ const VectorInvariantKineticEnergyUpwinding = VectorInvariant{<:Any, <:Any, # VectorInvariant{N, FT, M, Z, ZS, V, K, D, U (upwinding) const VectorInvariantCrossVerticalUpwinding = VectorInvariant{<:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:AbstractUpwindBiasedAdvectionScheme, <:CrossAndSelfUpwinding} const VectorInvariantSelfVerticalUpwinding = VectorInvariant{<:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:AbstractUpwindBiasedAdvectionScheme, <:OnlySelfUpwinding} -const VectorInvariantVelocityVerticalUpwinding = VectorInvariant{<:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:AbstractUpwindBiasedAdvectionScheme, <:VelocityUpwinding} Base.summary(a::VectorInvariant) = string("Vector Invariant, Dimension-by-dimension reconstruction") Base.summary(a::MultiDimensionalVectorInvariant) = string("Vector Invariant, Multidimensional reconstruction") diff --git a/src/Advection/vector_invariant_upwinding.jl b/src/Advection/vector_invariant_upwinding.jl index b2b24470a0..4949a453e2 100644 --- a/src/Advection/vector_invariant_upwinding.jl +++ b/src/Advection/vector_invariant_upwinding.jl @@ -88,25 +88,8 @@ CrossAndSelfUpwinding(; cross_scheme = CenteredSecondOrder(), δv²_stencil = FunctionStencil(v_smoothness), ) = CrossAndSelfUpwinding(extract_centered_scheme(cross_scheme), divergence_stencil, δu²_stencil, δv²_stencil) -""" - VelocityUpwinding(; cross_scheme = CenteredSecondOrder()) - -Upwinding treatment for Divergence fluxes and Kinetic Energy gradient in the Vector Invariant formulation, whereas only -the terms corresponding to the transporting velocity are upwinded. (i.e., terms in `u` in the zonal momentum equation and -terms in `v` in the meridional momentum equation). Contrarily to `OnlySelfUpwinding`, the reconstruction (and hence the -upwinding) is done _inside_ the gradient operator, i.e., velocities are reconstructed instead of velocity derivatives. - -Keyword arguments -================= - -- `cross_scheme`: Advection scheme used for cross-reconstructed terms (tangential velocities) - in the kinetic energy gradient and the divergence flux. Defaults to `CenteredSecondOrder()`. -""" -VelocityUpwinding(; cross_scheme = CenteredSecondOrder()) = VelocityUpwinding(extract_centered_scheme(cross_scheme)) - Base.summary(a::OnlySelfUpwinding) = "OnlySelfUpwinding" Base.summary(a::CrossAndSelfUpwinding) = "CrossAndSelfUpwinding" -Base.summary(a::VelocityUpwinding) = "VelocityUpwinding" Base.show(io::IO, a::OnlySelfUpwinding) = print(io, summary(a), " \n", @@ -139,12 +122,3 @@ Adapt.adapt_structure(to, scheme::CrossAndSelfUpwinding) = Adapt.adapt(to, scheme.divergence_stencil), Adapt.adapt(to, scheme.δu²_stencil), Adapt.adapt(to, scheme.δv²_stencil)) - -Base.show(io::IO, a::VelocityUpwinding) = - print(io, summary(a), " \n", - "KE gradient and Divergence flux cross terms reconstruction: ", "\n", - "└── $(summary(a.cross_scheme))") - -Adapt.adapt_structure(to, scheme::VelocityUpwinding) = - VelocityUpwinding(Adapt.adapt(to, scheme.cross_scheme)) - diff --git a/src/Advection/vector_invariant_velocity_upwinding.jl b/src/Advection/vector_invariant_velocity_upwinding.jl deleted file mode 100644 index 167cb735cf..0000000000 --- a/src/Advection/vector_invariant_velocity_upwinding.jl +++ /dev/null @@ -1,97 +0,0 @@ -##### -##### Velocity upwinding is a Partial Upwinding where the upwind choice occurrs _inside_ -##### the difference operator (i.e., velocity upwinding) instead of outside (i.e., derivative upwinding). -##### _MOST_ stable formulation at the expense of a low kinetic energy -##### - -##### -##### Velocity Upwinding of Divergence flux -##### - -@inline function upwinded_Ax_uᶜᶜᶜ(i, j, k, grid, scheme, u) - û = ℑxᶜᵃᵃ(i, j, k, grid, u) - - Uᴸ = _left_biased_interpolate_xᶜᵃᵃ(i, j, k, grid, scheme, scheme.divergence_scheme, Ax_qᶠᶜᶜ, u) - Uᴿ = _right_biased_interpolate_xᶜᵃᵃ(i, j, k, grid, scheme, scheme.divergence_scheme, Ax_qᶠᶜᶜ, u) - - return ifelse(û > 0, Uᴸ, Uᴿ) -end - -@inline function upwinded_Ay_vᶜᶜᶜ(i, j, k, grid, scheme, v) - v̂ = ℑyᵃᶜᵃ(i, j, k, grid, v) - - Vᴸ = _left_biased_interpolate_yᵃᶜᵃ(i, j, k, grid, scheme, scheme.divergence_scheme, Ay_qᶜᶠᶜ, v) - Vᴿ = _right_biased_interpolate_yᵃᶜᵃ(i, j, k, grid, scheme, scheme.divergence_scheme, Ay_qᶜᶠᶜ, v) - - return ifelse(v̂ > 0, Vᴸ, Vᴿ) -end - -@inline reconstructed_Ax_uᶠᶠᶜ(i, j, k, grid, scheme, u) = - _symmetric_interpolate_yᵃᶠᵃ(i, j, k, grid, scheme, scheme.upwinding.cross_scheme, Ax_qᶠᶜᶜ, u) - -@inline reconstructed_Ay_vᶠᶠᶜ(i, j, k, grid, scheme, v) = - _symmetric_interpolate_xᶠᵃᵃ(i, j, k, grid, scheme, scheme.upwinding.cross_scheme, Ay_qᶜᶠᶜ, v) - -@inline function upwind_divergence_flux_Uᶠᶜᶜ(i, j, k, grid, scheme::VectorInvariantVelocityVerticalUpwinding, u, v) - @inbounds û = u[i, j, k] - - δu = δxᶠᶜᶜ(i, j, k, grid, upwinded_Ax_uᶜᶜᶜ, scheme, u) - δv = δyᶠᶜᶜ(i, j, k, grid, reconstructed_Ay_vᶠᶠᶜ, scheme, v) - - return û * (δu + δv) -end - -@inline function upwind_divergence_flux_Vᶜᶠᶜ(i, j, k, grid, scheme::VectorInvariantVelocityVerticalUpwinding, u, v) - @inbounds v̂ = v[i, j, k] - - δu = δxᶜᵃᵃ(i, j, k, grid, upwinded_Ax_uᶠᶠᶜ, scheme, u) - δv = δyᵃᶠᵃ(i, j, k, grid, reconstructed_Ay_vᶜᶜᶜ, scheme, v) - - return v̂ * (δu + δv) -end - -##### -##### Velocity Upwinding of Kinetic Energy gradient -##### - -const VectorInvariantVelocityKEGradientUpwinding = VectorInvariant{<:Any, <:Any, <:Any, <:Any, <:Any, <:AbstractUpwindBiasedAdvectionScheme, <:VelocityUpwinding} - -@inline function upwinded_u²ᶜᶜᶜ(i, j, k, grid, scheme, u) - û = ℑxᶜᵃᵃ(i, j, k, grid, u) - - Uᴸ = _left_biased_interpolate_xᶜᵃᵃ(i, j, k, grid, scheme, scheme.kinetic_energy_gradient_scheme, half_ϕ², u) - Uᴿ = _right_biased_interpolate_xᶜᵃᵃ(i, j, k, grid, scheme, scheme.kinetic_energy_gradient_scheme, half_ϕ², u) - - return ifelse(û > 0, Uᴸ, Uᴿ) -end - -@inline function upwinded_v²ᶜᶜᶜ(i, j, k, grid, scheme, v) - v̂ = ℑyᵃᶜᵃ(i, j, k, grid, v) - - Vᴸ = _left_biased_interpolate_yᵃᶜᵃ(i, j, k, grid, scheme, scheme.kinetic_energy_gradient_scheme, half_ϕ², v) - Vᴿ = _right_biased_interpolate_yᵃᶜᵃ(i, j, k, grid, scheme, scheme.kinetic_energy_gradient_scheme, half_ϕ², v) - - return ifelse(v̂ > 0, Vᴸ, Vᴿ) -end - -@inline reconstructed_u²ᶜᶜᶜ(i, j, k, grid, scheme, u) = - _symmetric_interpolate_xᶜᵃᵃ(i, j, k, grid, scheme, scheme.upwinding.cross_scheme, half_ϕ², u) - -@inline reconstructed_v²ᶜᶜᶜ(i, j, k, grid, scheme, v) = - _symmetric_interpolate_yᵃᶜᵃ(i, j, k, grid, scheme, scheme.upwinding.cross_scheme, half_ϕ², v) - -@inline function bernoulli_head_U(i, j, k, grid, scheme::VectorInvariantVelocityKEGradientUpwinding, u, v) - - δKu = δxᶠᵃᵃ(i, j, k, grid, upwinded_u²ᶜᶜᶜ, scheme, u) - δKv = δxᶠᵃᵃ(i, j, k, grid, reconstructed_v²ᶜᶜᶜ, scheme, v) - - return (δKu + δKv) / Δxᶠᶜᶜ(i, j, k, grid) -end - -@inline function bernoulli_head_V(i, j, k, grid, scheme::VectorInvariantVelocityKEGradientUpwinding, u, v) - - δKu = δyᵃᶠᵃ(i, j, k, grid, upwinded_u²ᶜᶜᶜ, scheme, u) - δKv = δyᵃᶠᵃ(i, j, k, grid, reconstructed_v²ᶜᶜᶜ, scheme, v) - - return (δKu + δKv) / Δyᶜᶠᶜ(i, j, k, grid) -end diff --git a/src/Advection/weno_interpolants.jl b/src/Advection/weno_interpolants.jl index 7c96b00adb..dd7cfa1bde 100644 --- a/src/Advection/weno_interpolants.jl +++ b/src/Advection/weno_interpolants.jl @@ -212,22 +212,11 @@ end return :($(elem...),) end -# JSWENO α weights dᵣ / (βᵣ + ε)² -@inline function metaprogrammed_js_alpha_loop(buffer) - elem = Vector(undef, buffer) - for stencil = 1:buffer - elem[stencil] = :(@inbounds FT(coeff(scheme, Val($(stencil-1)))) / (β[$stencil] + FT(ε))^ƞ) - end - - return :($(elem...),) -end - for buffer in [2, 3, 4, 5, 6] @eval begin @inline beta_sum(scheme::WENO{$buffer}, β₁, β₂) = @inbounds $(metaprogrammed_beta_sum(buffer)) @inline beta_loop(scheme::WENO{$buffer}, ψ, func) = @inbounds $(metaprogrammed_beta_loop(buffer)) @inline zweno_alpha_loop(scheme::WENO{$buffer}, β, τ, coeff, FT) = @inbounds $(metaprogrammed_zweno_alpha_loop(buffer)) - @inline js_alpha_loop(scheme::WENO{$buffer}, β, coeff, FT) = @inbounds $(metaprogrammed_js_alpha_loop(buffer)) end end @@ -253,12 +242,9 @@ for (side, coeff) in zip([:left, :right], (:Cl, :Cr)) @inbounds begin β = beta_loop(scheme, ψ, $biased_β) - if scheme isa ZWENO - τ = global_smoothness_indicator(Val(N), β) - α = zweno_alpha_loop(scheme, β, τ, $coeff, FT) - else - α = js_alpha_loop(scheme, β, $coeff, FT) - end + τ = global_smoothness_indicator(Val(N), β) + α = zweno_alpha_loop(scheme, β, τ, $coeff, FT) + return α ./ sum(α) end end @@ -274,12 +260,9 @@ for (side, coeff) in zip([:left, :right], (:Cl, :Cr)) β = beta_sum(scheme, βᵤ, βᵥ) - if scheme isa ZWENO - τ = global_smoothness_indicator(Val(N), β) - α = zweno_alpha_loop(scheme, β, τ, $coeff, FT) - else - α = js_alpha_loop(scheme, β, $coeff, FT) - end + τ = global_smoothness_indicator(Val(N), β) + α = zweno_alpha_loop(scheme, β, τ, $coeff, FT) + return α ./ sum(α) end end diff --git a/src/Advection/weno_reconstruction.jl b/src/Advection/weno_reconstruction.jl index 49e00f9a0b..5ed5a16adc 100644 --- a/src/Advection/weno_reconstruction.jl +++ b/src/Advection/weno_reconstruction.jl @@ -2,7 +2,7 @@ ##### Weighted Essentially Non-Oscillatory (WENO) advection scheme ##### -struct WENO{N, FT, XT, YT, ZT, WF, PP, CA, SI} <: AbstractUpwindBiasedAdvectionScheme{N, FT} +struct WENO{N, FT, XT, YT, ZT, PP, CA, SI} <: AbstractUpwindBiasedAdvectionScheme{N, FT} "Coefficient for ENO reconstruction on x-faces" coeff_xᶠᵃᵃ::XT @@ -25,16 +25,16 @@ struct WENO{N, FT, XT, YT, ZT, WF, PP, CA, SI} <: AbstractUpwindBiasedAdvectionS "Reconstruction scheme used for symmetric interpolation" advecting_velocity_scheme :: SI - function WENO{N, FT, WF}(coeff_xᶠᵃᵃ::XT, coeff_xᶜᵃᵃ::XT, - coeff_yᵃᶠᵃ::YT, coeff_yᵃᶜᵃ::YT, - coeff_zᵃᵃᶠ::ZT, coeff_zᵃᵃᶜ::ZT, - bounds::PP, buffer_scheme::CA, - advecting_velocity_scheme :: SI) where {N, FT, XT, YT, ZT, WF, PP, CA, SI} + function WENO{N, FT}(coeff_xᶠᵃᵃ::XT, coeff_xᶜᵃᵃ::XT, + coeff_yᵃᶠᵃ::YT, coeff_yᵃᶜᵃ::YT, + coeff_zᵃᵃᶠ::ZT, coeff_zᵃᵃᶜ::ZT, + bounds::PP, buffer_scheme::CA, + advecting_velocity_scheme :: SI) where {N, FT, XT, YT, ZT, PP, CA, SI} - return new{N, FT, XT, YT, ZT, WF, PP, CA, SI}(coeff_xᶠᵃᵃ, coeff_xᶜᵃᵃ, - coeff_yᵃᶠᵃ, coeff_yᵃᶜᵃ, - coeff_zᵃᵃᶠ, coeff_zᵃᵃᶜ, - bounds, buffer_scheme, advecting_velocity_scheme) + return new{N, FT, XT, YT, ZT, PP, CA, SI}(coeff_xᶠᵃᵃ, coeff_xᶜᵃᵃ, + coeff_yᵃᶠᵃ, coeff_yᵃᶜᵃ, + coeff_zᵃᵃᶠ, coeff_zᵃᵃᶜ, + bounds, buffer_scheme, advecting_velocity_scheme) end end @@ -42,7 +42,6 @@ end WENO([FT=Float64;] order = 5, grid = nothing, - zweno = true, bounds = nothing) Construct a weighted essentially non-oscillatory advection scheme of order `order`. @@ -52,8 +51,6 @@ Keyword arguments - `order`: The order of the WENO advection scheme. Default: 5 - `grid`: (defaults to `nothing`) -- `zweno`: When `true` implement a Z-WENO formulation for the WENO weights calculation. - (defaults to `true`) Examples ======== @@ -62,8 +59,6 @@ julia> using Oceananigans julia> WENO() WENO reconstruction order 5 - Smoothness formulation: - └── Z-weno Boundary scheme: └── WENO reconstruction order 3 Symmetric scheme: @@ -88,8 +83,6 @@ julia> grid = RectilinearGrid(size = (Nx, Nz), halo = (4, 4), topology=(Periodic julia> WENO(grid; order=7) WENO reconstruction order 7 - Smoothness formulation: - └── Z-weno Boundary scheme: └── WENO reconstruction order 5 Symmetric scheme: @@ -103,7 +96,6 @@ WENO reconstruction order 7 function WENO(FT::DataType=Float64; order = 5, grid = nothing, - zweno = true, bounds = nothing) if !(grid isa Nothing) @@ -119,11 +111,11 @@ function WENO(FT::DataType=Float64; N = Int((order + 1) ÷ 2) weno_coefficients = compute_reconstruction_coefficients(grid, FT, :WENO; order = N) - buffer_scheme = WENO(FT; grid, order = order - 2, zweno, bounds) + buffer_scheme = WENO(FT; grid, order = order - 2, bounds) advecting_velocity_scheme = Centered(FT; grid, order = order - 1) end - return WENO{N, FT, zweno}(weno_coefficients..., bounds, buffer_scheme, advecting_velocity_scheme) + return WENO{N, FT}(weno_coefficients..., bounds, buffer_scheme, advecting_velocity_scheme) end WENO(grid, FT::DataType=Float64; kwargs...) = WENO(FT; grid, kwargs...) @@ -133,15 +125,12 @@ WENOThirdOrder(grid=nothing, FT::DataType=Float64; kwargs...) = WENO(grid, FT; WENOFifthOrder(grid=nothing, FT::DataType=Float64; kwargs...) = WENO(grid, FT; order=5, kwargs...) # Flavours of WENO -const ZWENO = WENO{<:Any, <:Any, <:Any, <:Any, <:Any, true} -const PositiveWENO = WENO{<:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Tuple} +const PositiveWENO = WENO{<:Any, <:Any, <:Any, <:Any, <:Any, <:Tuple} Base.summary(a::WENO{N}) where N = string("WENO reconstruction order ", N*2-1) -Base.show(io::IO, a::WENO{N, FT, RX, RY, RZ, WF, PP}) where {N, FT, RX, RY, RZ, WF, PP} = +Base.show(io::IO, a::WENO{N, FT, RX, RY, RZ, PP}) where {N, FT, RX, RY, RZ, PP} = print(io, summary(a), " \n", - " Smoothness formulation: ", "\n", - " └── $(WF ? "Z-weno" : "JS-weno") \n", a.bounds isa Nothing ? "" : " Bounds : \n └── $(a.bounds) \n", " Boundary scheme: ", "\n", " └── ", summary(a.buffer_scheme) , "\n", @@ -152,21 +141,21 @@ Base.show(io::IO, a::WENO{N, FT, RX, RY, RZ, WF, PP}) where {N, FT, RX, RY, RZ, " ├── Y $(RY == Nothing ? "regular" : "stretched") \n", " └── Z $(RZ == Nothing ? "regular" : "stretched")" ) -Adapt.adapt_structure(to, scheme::WENO{N, FT, XT, YT, ZT, WF, PP}) where {N, FT, XT, YT, ZT, WF, PP} = - WENO{N, FT, WF}(Adapt.adapt(to, scheme.coeff_xᶠᵃᵃ), Adapt.adapt(to, scheme.coeff_xᶜᵃᵃ), - Adapt.adapt(to, scheme.coeff_yᵃᶠᵃ), Adapt.adapt(to, scheme.coeff_yᵃᶜᵃ), - Adapt.adapt(to, scheme.coeff_zᵃᵃᶠ), Adapt.adapt(to, scheme.coeff_zᵃᵃᶜ), - Adapt.adapt(to, scheme.bounds), - Adapt.adapt(to, scheme.buffer_scheme), - Adapt.adapt(to, scheme.advecting_velocity_scheme)) - -on_architecture(to, scheme::WENO{N, FT, XT, YT, ZT, WF, PP}) where {N, FT, XT, YT, ZT, WF, PP} = - WENO{N, FT, WF}(on_architecture(to, scheme.coeff_xᶠᵃᵃ), on_architecture(to, scheme.coeff_xᶜᵃᵃ), - on_architecture(to, scheme.coeff_yᵃᶠᵃ), on_architecture(to, scheme.coeff_yᵃᶜᵃ), - on_architecture(to, scheme.coeff_zᵃᵃᶠ), on_architecture(to, scheme.coeff_zᵃᵃᶜ), - on_architecture(to, scheme.bounds), - on_architecture(to, scheme.buffer_scheme), - on_architecture(to, scheme.advecting_velocity_scheme)) +Adapt.adapt_structure(to, scheme::WENO{N, FT, XT, YT, ZT, PP}) where {N, FT, XT, YT, ZT, PP} = + WENO{N, FT}(Adapt.adapt(to, scheme.coeff_xᶠᵃᵃ), Adapt.adapt(to, scheme.coeff_xᶜᵃᵃ), + Adapt.adapt(to, scheme.coeff_yᵃᶠᵃ), Adapt.adapt(to, scheme.coeff_yᵃᶜᵃ), + Adapt.adapt(to, scheme.coeff_zᵃᵃᶠ), Adapt.adapt(to, scheme.coeff_zᵃᵃᶜ), + Adapt.adapt(to, scheme.bounds), + Adapt.adapt(to, scheme.buffer_scheme), + Adapt.adapt(to, scheme.advecting_velocity_scheme)) + +on_architecture(to, scheme::WENO{N, FT, XT, YT, ZT, PP}) where {N, FT, XT, YT, ZT, PP} = + WENO{N, FT}(on_architecture(to, scheme.coeff_xᶠᵃᵃ), on_architecture(to, scheme.coeff_xᶜᵃᵃ), + on_architecture(to, scheme.coeff_yᵃᶠᵃ), on_architecture(to, scheme.coeff_yᵃᶜᵃ), + on_architecture(to, scheme.coeff_zᵃᵃᶠ), on_architecture(to, scheme.coeff_zᵃᵃᶜ), + on_architecture(to, scheme.bounds), + on_architecture(to, scheme.buffer_scheme), + on_architecture(to, scheme.advecting_velocity_scheme)) # Retrieve precomputed coefficients (+2 for julia's 1 based indices) @inline retrieve_coeff(scheme::WENO, r, ::Val{1}, i, ::Type{Face}) = @inbounds scheme.coeff_xᶠᵃᵃ[r+2][i]