Skip to content

Commit

Permalink
Small changes regarding variable name on tests (#88)
Browse files Browse the repository at this point in the history
* Fix 1D

* Fix 2D

* Fix 3D

* Minor change
  • Loading branch information
huiyuxie authored Dec 10, 2024
1 parent 6956b3c commit 0b41d32
Show file tree
Hide file tree
Showing 47 changed files with 93 additions and 93 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Our current focus is on the semidiscretization of PDEs. The table below shows th
| `DGMultiMesh` | 1D, 2D, 3D | `DGMulti` | 🟡 Planned |

# Example of PDE Semidiscretization on GPU
Let's take a look at a simple example to see how to use **TrixiCUDA.jl** to run the simulation on the GPU (now only CUDA-compatible).
Let's take a look at a simple example to see how to use TrixiCUDA.jl to run the simulation on the GPU (now only CUDA-compatible).

```julia
# Take 1D linear advection equation as an example
Expand Down
4 changes: 2 additions & 2 deletions test/tree_dgsem_1d/advection_basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ include("../test_macros.jl")
semi_gpu = SemidiscretizationHyperbolicGPU(mesh, equations, initial_condition_convergence_test,
solver)

tspan = (0.0, 1.0)
tspan = tspan_gpu = (0.0, 1.0)
t = t_gpu = 0.0

# Semi on CPU
Expand All @@ -43,7 +43,7 @@ include("../test_macros.jl")
du = Trixi.wrap_array(du_ode, mesh, equations, solver, cache)

# ODE on GPU
ode_gpu = semidiscretizeGPU(semi_gpu, tspan)
ode_gpu = semidiscretizeGPU(semi_gpu, tspan_gpu)
u_gpu = copy(ode_gpu.u0)
du_gpu = similar(u_gpu)

Expand Down
4 changes: 2 additions & 2 deletions test/tree_dgsem_1d/advection_extended.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ include("../test_macros.jl")
semi_gpu = SemidiscretizationHyperbolicGPU(mesh, equations, initial_condition, solver,
boundary_conditions = boundary_conditions)

tspan = (0.0, 1.0)
tspan = tspan_gpu = (0.0, 1.0)
t = t_gpu = 0.0

# Semi on CPU
Expand All @@ -48,7 +48,7 @@ include("../test_macros.jl")
du = Trixi.wrap_array(du_ode, mesh, equations, solver, cache)

# ODE on GPU
ode_gpu = semidiscretizeGPU(semi_gpu, tspan)
ode_gpu = semidiscretizeGPU(semi_gpu, tspan_gpu)
u_gpu = copy(ode_gpu.u0)
du_gpu = similar(u_gpu)

Expand Down
4 changes: 2 additions & 2 deletions test/tree_dgsem_1d/burgers_basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ include("../test_macros.jl")
semi_gpu = SemidiscretizationHyperbolicGPU(mesh, equations, initial_condition, solver,
source_terms = source_terms_convergence_test)

tspan = (0.0, 2.0)
tspan = tspan_gpu = (0.0, 2.0)
t = t_gpu = 0.0

# Semi on CPU
Expand All @@ -43,7 +43,7 @@ include("../test_macros.jl")
du = Trixi.wrap_array(du_ode, mesh, equations, solver, cache)

# ODE on GPU
ode_gpu = semidiscretizeGPU(semi_gpu, tspan)
ode_gpu = semidiscretizeGPU(semi_gpu, tspan_gpu)
u_gpu = copy(ode_gpu.u0)
du_gpu = similar(u_gpu)

Expand Down
4 changes: 2 additions & 2 deletions test/tree_dgsem_1d/burgers_rarefraction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ include("../test_macros.jl")
semi_gpu = SemidiscretizationHyperbolicGPU(mesh, equations, initial_condition, solver,
boundary_conditions = boundary_conditions)

tspan = (0.0, 0.2)
tspan = tspan_gpu = (0.0, 0.2)
t = t_gpu = 0.0

# Semi on CPU
Expand All @@ -81,7 +81,7 @@ include("../test_macros.jl")
du = Trixi.wrap_array(du_ode, mesh, equations, solver, cache)

# ODE on GPU
ode_gpu = semidiscretizeGPU(semi_gpu, tspan)
ode_gpu = semidiscretizeGPU(semi_gpu, tspan_gpu)
u_gpu = copy(ode_gpu.u0)
du_gpu = similar(u_gpu)

Expand Down
4 changes: 2 additions & 2 deletions test/tree_dgsem_1d/burgers_shock.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ include("../test_macros.jl")
semi_gpu = SemidiscretizationHyperbolicGPU(mesh, equations, initial_condition, solver,
boundary_conditions = boundary_conditions)

tspan = (0.0, 0.2)
tspan = tspan_gpu = (0.0, 0.2)
t = t_gpu = 0.0

# Semi on CPU
Expand All @@ -82,7 +82,7 @@ include("../test_macros.jl")
du = Trixi.wrap_array(du_ode, mesh, equations, solver, cache)

# ODE on GPU
ode_gpu = semidiscretizeGPU(semi_gpu, tspan)
ode_gpu = semidiscretizeGPU(semi_gpu, tspan_gpu)
u_gpu = copy(ode_gpu.u0)
du_gpu = similar(u_gpu)

Expand Down
4 changes: 2 additions & 2 deletions test/tree_dgsem_1d/euler_blast_wave.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ include("../test_macros.jl")
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)
semi_gpu = SemidiscretizationHyperbolicGPU(mesh, equations, initial_condition, solver)

tspan = (0.0, 12.5)
tspan = tspan_gpu = (0.0, 12.5)
t = t_gpu = 0.0

# Semi on CPU
Expand All @@ -66,7 +66,7 @@ include("../test_macros.jl")
du = Trixi.wrap_array(du_ode, mesh, equations, solver, cache)

# ODE on GPU
ode_gpu = semidiscretizeGPU(semi_gpu, tspan)
ode_gpu = semidiscretizeGPU(semi_gpu, tspan_gpu)
u_gpu = copy(ode_gpu.u0)
du_gpu = similar(u_gpu)

Expand Down
4 changes: 2 additions & 2 deletions test/tree_dgsem_1d/euler_ec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ include("../test_macros.jl")
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)
semi_gpu = SemidiscretizationHyperbolicGPU(mesh, equations, initial_condition, solver)

tspan = (0.0, 0.4)
tspan = tspan_gpu = (0.0, 0.4)
t = t_gpu = 0.0

# Semi on CPU
Expand All @@ -43,7 +43,7 @@ include("../test_macros.jl")
du = Trixi.wrap_array(du_ode, mesh, equations, solver, cache)

# ODE on GPU
ode_gpu = semidiscretizeGPU(semi_gpu, tspan)
ode_gpu = semidiscretizeGPU(semi_gpu, tspan_gpu)
u_gpu = copy(ode_gpu.u0)
du_gpu = similar(u_gpu)

Expand Down
4 changes: 2 additions & 2 deletions test/tree_dgsem_1d/euler_shock.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ include("../test_macros.jl")
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)
semi_gpu = SemidiscretizationHyperbolicGPU(mesh, equations, initial_condition, solver)

tspan = (0.0, 1.0)
tspan = tspan_gpu = (0.0, 1.0)
t = t_gpu = 0.0

# Semi on CPU
Expand All @@ -52,7 +52,7 @@ include("../test_macros.jl")
du = Trixi.wrap_array(du_ode, mesh, equations, solver, cache)

# ODE on GPU
ode_gpu = semidiscretizeGPU(semi_gpu, tspan)
ode_gpu = semidiscretizeGPU(semi_gpu, tspan_gpu)
u_gpu = copy(ode_gpu.u0)
du_gpu = similar(u_gpu)

Expand Down
4 changes: 2 additions & 2 deletions test/tree_dgsem_1d/euler_source_terms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ include("../test_macros.jl")
semi_gpu = SemidiscretizationHyperbolicGPU(mesh, equations, initial_condition, solver,
source_terms = source_terms_convergence_test)

tspan = (0.0, 2.0)
tspan = tspan_gpu = (0.0, 2.0)
t = t_gpu = 0.0

# Semi on CPU
Expand All @@ -43,7 +43,7 @@ include("../test_macros.jl")
du = Trixi.wrap_array(du_ode, mesh, equations, solver, cache)

# ODE on GPU
ode_gpu = semidiscretizeGPU(semi_gpu, tspan)
ode_gpu = semidiscretizeGPU(semi_gpu, tspan_gpu)
u_gpu = copy(ode_gpu.u0)
du_gpu = similar(u_gpu)

Expand Down
4 changes: 2 additions & 2 deletions test/tree_dgsem_1d/euler_source_terms_nonperiodic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ include("../test_macros.jl")
source_terms = source_terms_convergence_test,
boundary_conditions = boundary_conditions)

tspan = (0.0, 2.0)
tspan = tspan_gpu = (0.0, 2.0)
t = t_gpu = 0.0

# Semi on CPU
Expand All @@ -50,7 +50,7 @@ include("../test_macros.jl")
du = Trixi.wrap_array(du_ode, mesh, equations, solver, cache)

# ODE on GPU
ode_gpu = semidiscretizeGPU(semi_gpu, tspan)
ode_gpu = semidiscretizeGPU(semi_gpu, tspan_gpu)
u_gpu = copy(ode_gpu.u0)
du_gpu = similar(u_gpu)

Expand Down
4 changes: 2 additions & 2 deletions test/tree_dgsem_1d/eulermulti_ec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ include("../test_macros.jl")
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)
semi_gpu = SemidiscretizationHyperbolicGPU(mesh, equations, initial_condition, solver)

tspan = (0.0, 0.4)
tspan = tspan_gpu = (0.0, 0.4)
t = t_gpu = 0.0

# Semi on CPU
Expand All @@ -49,7 +49,7 @@ include("../test_macros.jl")
du = Trixi.wrap_array(du_ode, mesh, equations, solver, cache)

# ODE on GPU
ode_gpu = semidiscretizeGPU(semi_gpu, tspan)
ode_gpu = semidiscretizeGPU(semi_gpu, tspan_gpu)
u_gpu = copy(ode_gpu.u0)
du_gpu = similar(u_gpu)

Expand Down
4 changes: 2 additions & 2 deletions test/tree_dgsem_1d/eulermulti_es.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ include("../test_macros.jl")
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)
semi_gpu = SemidiscretizationHyperbolicGPU(mesh, equations, initial_condition, solver)

tspan = (0.0, 0.4)
tspan = tspan_gpu = (0.0, 0.4)
t = t_gpu = 0.0

# Semi on CPU
Expand All @@ -44,7 +44,7 @@ include("../test_macros.jl")
du = Trixi.wrap_array(du_ode, mesh, equations, solver, cache)

# ODE on GPU
ode_gpu = semidiscretizeGPU(semi_gpu, tspan)
ode_gpu = semidiscretizeGPU(semi_gpu, tspan_gpu)
u_gpu = copy(ode_gpu.u0)
du_gpu = similar(u_gpu)

Expand Down
4 changes: 2 additions & 2 deletions test/tree_dgsem_1d/eulerquasi_ec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ include("../test_macros.jl")
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)
semi_gpu = SemidiscretizationHyperbolicGPU(mesh, equations, initial_condition, solver)

tspan = (0.0, 0.4)
tspan = tspan_gpu = (0.0, 0.4)
t = t_gpu = 0.0

# Semi on CPU
Expand All @@ -53,7 +53,7 @@ include("../test_macros.jl")
du = Trixi.wrap_array(du_ode, mesh, equations, solver, cache)

# ODE on GPU
ode_gpu = semidiscretizeGPU(semi_gpu, tspan)
ode_gpu = semidiscretizeGPU(semi_gpu, tspan_gpu)
u_gpu = copy(ode_gpu.u0)
du_gpu = similar(u_gpu)

Expand Down
4 changes: 2 additions & 2 deletions test/tree_dgsem_1d/eulerquasi_source_terms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ include("../test_macros.jl")
semi_gpu = SemidiscretizationHyperbolicGPU(mesh, equations, initial_condition, solver,
source_terms = source_terms_convergence_test)

tspan = (0.0, 2.0)
tspan = tspan_gpu = (0.0, 2.0)
t = t_gpu = 0.0

# Semi on CPU
Expand All @@ -46,7 +46,7 @@ include("../test_macros.jl")
du = Trixi.wrap_array(du_ode, mesh, equations, solver, cache)

# ODE on GPU
ode_gpu = semidiscretizeGPU(semi_gpu, tspan)
ode_gpu = semidiscretizeGPU(semi_gpu, tspan_gpu)
u_gpu = copy(ode_gpu.u0)
du_gpu = similar(u_gpu)

Expand Down
4 changes: 2 additions & 2 deletions test/tree_dgsem_1d/hypdiff_harmonic_nonperiodic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ include("../test_macros.jl")
boundary_conditions = boundary_conditions,
source_terms = source_terms_harmonic)

tspan = (0.0, 30.0)
tspan = tspan_gpu = (0.0, 30.0)
t = t_gpu = 0.0

# Semi on CPU
Expand All @@ -62,7 +62,7 @@ include("../test_macros.jl")
du = Trixi.wrap_array(du_ode, mesh, equations, solver, cache)

# ODE on GPU
ode_gpu = semidiscretizeGPU(semi_gpu, tspan)
ode_gpu = semidiscretizeGPU(semi_gpu, tspan_gpu)
u_gpu = copy(ode_gpu.u0)
du_gpu = similar(u_gpu)

Expand Down
4 changes: 2 additions & 2 deletions test/tree_dgsem_1d/hypdiff_nonperiodic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ include("../test_macros.jl")
boundary_conditions = boundary_conditions,
source_terms = source_terms_poisson_nonperiodic)

tspan = (0.0, 5.0)
tspan = tspan_gpu = (0.0, 5.0)
t = t_gpu = 0.0

# Semi on CPU
Expand All @@ -48,7 +48,7 @@ include("../test_macros.jl")
du = Trixi.wrap_array(du_ode, mesh, equations, solver, cache)

# ODE on GPU
ode_gpu = semidiscretizeGPU(semi_gpu, tspan)
ode_gpu = semidiscretizeGPU(semi_gpu, tspan_gpu)
u_gpu = copy(ode_gpu.u0)
du_gpu = similar(u_gpu)

Expand Down
4 changes: 2 additions & 2 deletions test/tree_dgsem_1d/mhd_alfven_wave.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ include("../test_macros.jl")
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)
semi_gpu = SemidiscretizationHyperbolicGPU(mesh, equations, initial_condition, solver)

tspan = (0.0, 2.0)
tspan = tspan_gpu = (0.0, 2.0)
t = t_gpu = 0.0

# Semi on CPU
Expand All @@ -44,7 +44,7 @@ include("../test_macros.jl")
du = Trixi.wrap_array(du_ode, mesh, equations, solver, cache)

# ODE on GPU
ode_gpu = semidiscretizeGPU(semi_gpu, tspan)
ode_gpu = semidiscretizeGPU(semi_gpu, tspan_gpu)
u_gpu = copy(ode_gpu.u0)
du_gpu = similar(u_gpu)

Expand Down
4 changes: 2 additions & 2 deletions test/tree_dgsem_1d/mhd_ec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ include("../test_macros.jl")
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)
semi_gpu = SemidiscretizationHyperbolicGPU(mesh, equations, initial_condition, solver)

tspan = (0.0, 0.4)
tspan = tspan_gpu = (0.0, 0.4)
t = t_gpu = 0.0

# Semi on CPU
Expand All @@ -44,7 +44,7 @@ include("../test_macros.jl")
du = Trixi.wrap_array(du_ode, mesh, equations, solver, cache)

# ODE on GPU
ode_gpu = semidiscretizeGPU(semi_gpu, tspan)
ode_gpu = semidiscretizeGPU(semi_gpu, tspan_gpu)
u_gpu = copy(ode_gpu.u0)
du_gpu = similar(u_gpu)

Expand Down
4 changes: 2 additions & 2 deletions test/tree_dgsem_1d/shallowwater_shock.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ include("../test_macros.jl")
semi_gpu = SemidiscretizationHyperbolicGPU(mesh, equations, initial_condition, solver,
boundary_conditions = boundary_condition)

tspan = (0.0, 3.0)
tspan = tspan_gpu = (0.0, 3.0)
t = t_gpu = 0.0

# Semi on CPU
Expand All @@ -85,7 +85,7 @@ include("../test_macros.jl")
du = Trixi.wrap_array(du_ode, mesh, equations, solver, cache)

# ODE on GPU
ode_gpu = semidiscretizeGPU(semi_gpu, tspan)
ode_gpu = semidiscretizeGPU(semi_gpu, tspan_gpu)
u_gpu = copy(ode_gpu.u0)
du_gpu = similar(u_gpu)

Expand Down
4 changes: 2 additions & 2 deletions test/tree_dgsem_2d/advection_basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ include("../test_macros.jl")
semi_gpu = SemidiscretizationHyperbolicGPU(mesh, equations, initial_condition_convergence_test,
solver)

tspan = (0.0, 1.0)
tspan = tspan_gpu = (0.0, 1.0)
t = t_gpu = 0.0

# Semi on CPU
Expand All @@ -43,7 +43,7 @@ include("../test_macros.jl")
du = Trixi.wrap_array(du_ode, mesh, equations, solver, cache)

# ODE on GPU
ode_gpu = semidiscretizeGPU(semi_gpu, tspan)
ode_gpu = semidiscretizeGPU(semi_gpu, tspan_gpu)
u_gpu = copy(ode_gpu.u0)
du_gpu = similar(u_gpu)

Expand Down
4 changes: 2 additions & 2 deletions test/tree_dgsem_2d/advection_mortar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ include("../test_macros.jl")
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)
semi_gpu = SemidiscretizationHyperbolicGPU(mesh, equations, initial_condition, solver)

tspan = (0.0, 1.0)
tspan = tspan_gpu = (0.0, 1.0)
t = t_gpu = 0.0

# Semi on CPU
Expand All @@ -44,7 +44,7 @@ include("../test_macros.jl")
du = Trixi.wrap_array(du_ode, mesh, equations, solver, cache)

# ODE on GPU
ode_gpu = semidiscretizeGPU(semi_gpu, tspan)
ode_gpu = semidiscretizeGPU(semi_gpu, tspan_gpu)
u_gpu = copy(ode_gpu.u0)
du_gpu = similar(u_gpu)

Expand Down
Loading

0 comments on commit 0b41d32

Please sign in to comment.