-
Couldn't load subscription status.
- Fork 131
WIP: Enhanced p4est mesh view coupling #2456
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
base: main
Are you sure you want to change the base?
Conversation
…ework/Trixi.jl into sc/p4est-view-coupled
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Removed redundant code from structured mesh coupled semidiscretization.
for p4est mesh views.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…te_coupled_boundary_condition.
…ixi.jl into sc/p4est-view-coupled
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
| @trixi_testset "elixir_advection_coupled.jl" begin | ||
| @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_coupled.jl"), | ||
| l2=[0., 0.], | ||
| linf=[0., 0.]) | ||
| # Ensure that we do not have excessive memory allocations | ||
| # (e.g., from type instabilities) | ||
| @test_allocations(Trixi.rhs!, semi, sol, 1000) | ||
| # @test_allocations(Trixi.rhs!, semi, sol, 1000) | ||
|
|
||
| # Ensure we cover the calculation of the node coordinates | ||
| node_coordinates = typeof(parent_mesh.tree_node_coordinates)(undef, 2, | ||
| ntuple(_ -> length(parent_mesh.nodes), | ||
| 2)..., | ||
| length(mesh.cell_ids)) | ||
| result = Trixi.calc_node_coordinates!(node_coordinates, mesh, parent_mesh.nodes) | ||
| @test parent_mesh.tree_node_coordinates == result | ||
|
|
||
| length(mesh1.cell_ids)) | ||
| # Load the mesh file for code coverage. | ||
| loaded_mesh = Trixi.load_mesh_serial(joinpath("out", "mesh.h5"); n_cells_max = 0, | ||
| loaded_mesh = Trixi.load_mesh_serial(joinpath(EXAMPLES_DIR, "out", "mesh_1.h5"); n_cells_max = 0, | ||
| RealT = typeof(parent_mesh).parameters[3]) | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| @trixi_testset "elixir_advection_coupled.jl" begin | |
| @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_coupled.jl"), | |
| l2=[0., 0.], | |
| linf=[0., 0.]) | |
| # Ensure that we do not have excessive memory allocations | |
| # (e.g., from type instabilities) | |
| @test_allocations(Trixi.rhs!, semi, sol, 1000) | |
| # @test_allocations(Trixi.rhs!, semi, sol, 1000) | |
| # Ensure we cover the calculation of the node coordinates | |
| node_coordinates = typeof(parent_mesh.tree_node_coordinates)(undef, 2, | |
| ntuple(_ -> length(parent_mesh.nodes), | |
| 2)..., | |
| length(mesh.cell_ids)) | |
| result = Trixi.calc_node_coordinates!(node_coordinates, mesh, parent_mesh.nodes) | |
| @test parent_mesh.tree_node_coordinates == result | |
| length(mesh1.cell_ids)) | |
| # Load the mesh file for code coverage. | |
| loaded_mesh = Trixi.load_mesh_serial(joinpath("out", "mesh.h5"); n_cells_max = 0, | |
| loaded_mesh = Trixi.load_mesh_serial(joinpath(EXAMPLES_DIR, "out", "mesh_1.h5"); n_cells_max = 0, | |
| RealT = typeof(parent_mesh).parameters[3]) | |
| end | |
| @trixi_testset "elixir_advection_coupled.jl" begin | |
| @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_coupled.jl"), | |
| l2=[0.0, 0.0], | |
| linf=[0.0, 0.0]) | |
| # Ensure that we do not have excessive memory allocations | |
| # (e.g., from type instabilities) | |
| # @test_allocations(Trixi.rhs!, semi, sol, 1000) | |
| # Ensure we cover the calculation of the node coordinates | |
| node_coordinates = typeof(parent_mesh.tree_node_coordinates)(undef, 2, | |
| ntuple(_ -> length(parent_mesh.nodes), | |
| 2)..., | |
| length(mesh1.cell_ids)) | |
| # Load the mesh file for code coverage. | |
| loaded_mesh = Trixi.load_mesh_serial(joinpath(EXAMPLES_DIR, "out", "mesh_1.h5"); | |
| n_cells_max = 0, | |
| RealT = typeof(parent_mesh).parameters[3]) | |
| end |
| du_ode = similar(u_ode) | ||
| @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000 | ||
| end | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| end |
| @trixi_testset "elixir_euler_mhd_coupled.jl" begin | ||
| @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_mhd_coupled.jl"), | ||
| l2=[0.009862595305604965, | ||
| 0.011874205535856063, | ||
| 5.0185914245237475e-6, | ||
| 0.0, | ||
| 0.024657539839658474, | ||
| 0.0, | ||
| 0.0, | ||
| 0.0, | ||
| 0.0, | ||
| 0.0098589277826056, | ||
| 0.011870558900297097, | ||
| 6.882386285170543e-6, | ||
| 0.024648257743835045 | ||
| ], | ||
| linf=[0.013719847889148373, | ||
| 0.01678917375613853, | ||
| 2.933466212909218e-5, | ||
| 0.0, | ||
| 0.03429795097747568, | ||
| 0.0, | ||
| 0.0, | ||
| 0.0, | ||
| 0.0, | ||
| 0.01368217970493435, | ||
| 0.016790901855796785, | ||
| 3.091328454846926e-5, | ||
| 0.034236712653821444]) | ||
| # Ensure we cover the calculation of the node coordinates | ||
| node_coordinates = typeof(parent_mesh.tree_node_coordinates)(undef, 2, | ||
| ntuple(_ -> length(parent_mesh.nodes), | ||
| 2)..., | ||
| length(mesh1.cell_ids)) | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| @trixi_testset "elixir_euler_mhd_coupled.jl" begin | |
| @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_mhd_coupled.jl"), | |
| l2=[0.009862595305604965, | |
| 0.011874205535856063, | |
| 5.0185914245237475e-6, | |
| 0.0, | |
| 0.024657539839658474, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0098589277826056, | |
| 0.011870558900297097, | |
| 6.882386285170543e-6, | |
| 0.024648257743835045 | |
| ], | |
| linf=[0.013719847889148373, | |
| 0.01678917375613853, | |
| 2.933466212909218e-5, | |
| 0.0, | |
| 0.03429795097747568, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.01368217970493435, | |
| 0.016790901855796785, | |
| 3.091328454846926e-5, | |
| 0.034236712653821444]) | |
| # Ensure we cover the calculation of the node coordinates | |
| node_coordinates = typeof(parent_mesh.tree_node_coordinates)(undef, 2, | |
| ntuple(_ -> length(parent_mesh.nodes), | |
| 2)..., | |
| length(mesh1.cell_ids)) | |
| end | |
| @trixi_testset "elixir_euler_mhd_coupled.jl" begin | |
| @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_mhd_coupled.jl"), | |
| l2=[0.009862595305604965, | |
| 0.011874205535856063, | |
| 5.0185914245237475e-6, | |
| 0.0, | |
| 0.024657539839658474, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0098589277826056, | |
| 0.011870558900297097, | |
| 6.882386285170543e-6, | |
| 0.024648257743835045 | |
| ], | |
| linf=[0.013719847889148373, | |
| 0.01678917375613853, | |
| 2.933466212909218e-5, | |
| 0.0, | |
| 0.03429795097747568, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.0, | |
| 0.01368217970493435, | |
| 0.016790901855796785, | |
| 3.091328454846926e-5, | |
| 0.034236712653821444]) | |
| # Ensure we cover the calculation of the node coordinates | |
| node_coordinates = typeof(parent_mesh.tree_node_coordinates)(undef, 2, | |
| ntuple(_ -> length(parent_mesh.nodes), | |
| 2)..., | |
| length(mesh1.cell_ids)) | |
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
Trixi.jl/test/test_p4est_2d.jl
Lines 17 to 31 in 716ca60
| @trixi_testset "elixir_advection_basic.jl" begin | |
| @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), | |
| # Expected errors are exactly the same as with TreeMesh! | |
| l2=[8.311947673061856e-6], | |
| linf=[6.627000273229378e-5]) | |
| # Ensure that we do not have excessive memory allocations | |
| # (e.g., from type instabilities) | |
| @test_allocations(Trixi.rhs!, semi, sol, 1000) | |
| semi32 = Trixi.trixi_adapt(Array, Float32, semi) | |
| @test real(semi32.solver) == Float32 | |
| @test real(semi32.solver.basis) == Float32 | |
| @test real(semi32.solver.mortar) == Float32 | |
| # TODO: remake ignores the mesh itself as well | |
| @test real(semi32.mesh) == Float64 | |
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
Trixi.jl/test/test_p4est_2d.jl
Lines 104 to 111 in 716ca60
| @trixi_testset "elixir_advection_restart_amr.jl" begin | |
| @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart_amr.jl"), | |
| l2=[2.869137983727866e-6], | |
| linf=[3.8353423270964804e-5]) | |
| # Ensure that we do not have excessive memory allocations | |
| # (e.g., from type instabilities) | |
| @test_allocations(Trixi.rhs!, semi, sol, 1000) | |
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
Trixi.jl/test/test_p4est_2d.jl
Lines 560 to 578 in 716ca60
| @trixi_testset "elixir_mhd_alfven_wave.jl" begin | |
| @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_alfven_wave.jl"), | |
| l2=[1.0513414461545583e-5, 1.0517900957166411e-6, | |
| 1.0517900957304043e-6, 1.511816606372376e-6, | |
| 1.0443997728645063e-6, 7.879639064990798e-7, | |
| 7.879639065049896e-7, 1.0628631669056271e-6, | |
| 4.3382328912336153e-7], | |
| linf=[4.255466285174592e-5, 1.0029706745823264e-5, | |
| 1.0029706747467781e-5, 1.2122265939010224e-5, | |
| 5.4791097160444835e-6, 5.18922042269665e-6, | |
| 5.189220422141538e-6, 9.552667261422676e-6, | |
| 1.4237578427628152e-6]) | |
| # Ensure that we do not have excessive memory allocations | |
| # (e.g., from type instabilities) | |
| let | |
| t = sol.t[end] | |
| u_ode = sol.u[end] | |
| du_ode = similar(u_ode) | |
| @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
Trixi.jl/test/test_p4est_2d.jl
Lines 618 to 647 in 716ca60
| @trixi_testset "elixir_mhd_alfven_wave_nonconforming.jl" begin | |
| @test_trixi_include(joinpath(EXAMPLES_DIR, | |
| "elixir_mhd_alfven_wave_nonconforming.jl"), | |
| l2=[ | |
| 0.0322570437144848, | |
| 0.03598284801272945, | |
| 0.03562228071357411, | |
| 0.05288641880143085, | |
| 0.040752873778199326, | |
| 0.04207276835260492, | |
| 0.04171391252403866, | |
| 0.05289242879893149, | |
| 0.0016038935411812223 | |
| ], | |
| linf=[ | |
| 0.175984910510666, | |
| 0.13999726708245439, | |
| 0.13336032728399658, | |
| 0.21248359539637798, | |
| 0.133294808938885, | |
| 0.17934684696413217, | |
| 0.1831567822932948, | |
| 0.21575881133569155, | |
| 0.01967917976620703 | |
| ], | |
| tspan=(0.0, 0.25)) | |
| # Ensure that we do not have excessive memory allocations | |
| # (e.g., from type instabilities) | |
| @test_allocations(Trixi.rhs!, semi, sol, 1000) | |
| end |
Add the ability to couple systems that use more than one variable and p4est meshes.