Skip to content

Commit 206ce52

Browse files
Remove p1_{x,y,z} (#2619)
* Remove `dp1_{x,y,z}` * d --------- Co-authored-by: Hendrik Ranocha <[email protected]>
1 parent 589beb1 commit 206ce52

File tree

4 files changed

+101
-93
lines changed

4 files changed

+101
-93
lines changed

src/solvers/dgsem_tree/dg_1d.jl

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,27 @@ function create_cache(mesh::Union{TreeMesh{1}, StructuredMesh{1}}, equations,
4040
VolumeIntegralFluxDifferencing(volume_integral.volume_flux_dg),
4141
dg, uEltype)
4242

43-
A2dp1_x = Array{uEltype, 2}
44-
fstar1_L_threaded = A2dp1_x[A2dp1_x(undef, nvariables(equations), nnodes(dg) + 1)
45-
for _ in 1:Threads.maxthreadid()]
46-
fstar1_R_threaded = A2dp1_x[A2dp1_x(undef, nvariables(equations), nnodes(dg) + 1)
47-
for _ in 1:Threads.maxthreadid()]
43+
A2d = Array{uEltype, 2}
44+
fstar1_L_threaded = A2d[A2d(undef, nvariables(equations),
45+
nnodes(dg) + 1)
46+
for _ in 1:Threads.maxthreadid()]
47+
fstar1_R_threaded = A2d[A2d(undef, nvariables(equations),
48+
nnodes(dg) + 1)
49+
for _ in 1:Threads.maxthreadid()]
4850

4951
return (; cache..., fstar1_L_threaded, fstar1_R_threaded)
5052
end
5153

5254
function create_cache(mesh::Union{TreeMesh{1}, StructuredMesh{1}}, equations,
5355
volume_integral::AbstractVolumeIntegralPureLGLFiniteVolume,
5456
dg::DG, uEltype)
55-
A2dp1_x = Array{uEltype, 2}
56-
fstar1_L_threaded = A2dp1_x[A2dp1_x(undef, nvariables(equations), nnodes(dg) + 1)
57-
for _ in 1:Threads.maxthreadid()]
58-
fstar1_R_threaded = A2dp1_x[A2dp1_x(undef, nvariables(equations), nnodes(dg) + 1)
59-
for _ in 1:Threads.maxthreadid()]
57+
A2d = Array{uEltype, 2}
58+
fstar1_L_threaded = A2d[A2d(undef, nvariables(equations),
59+
nnodes(dg) + 1)
60+
for _ in 1:Threads.maxthreadid()]
61+
fstar1_R_threaded = A2d[A2d(undef, nvariables(equations),
62+
nnodes(dg) + 1)
63+
for _ in 1:Threads.maxthreadid()]
6064

6165
return (; fstar1_L_threaded, fstar1_R_threaded)
6266
end

src/solvers/dgsem_tree/dg_2d.jl

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,20 @@ function create_cache(mesh::Union{TreeMesh{2}, StructuredMesh{2}, UnstructuredMe
4141
VolumeIntegralFluxDifferencing(volume_integral.volume_flux_dg),
4242
dg, uEltype)
4343

44-
A3dp1_x = Array{uEltype, 3}
45-
A3dp1_y = Array{uEltype, 3}
46-
47-
fstar1_L_threaded = A3dp1_x[A3dp1_x(undef, nvariables(equations), nnodes(dg) + 1,
48-
nnodes(dg)) for _ in 1:Threads.maxthreadid()]
49-
fstar1_R_threaded = A3dp1_x[A3dp1_x(undef, nvariables(equations), nnodes(dg) + 1,
50-
nnodes(dg)) for _ in 1:Threads.maxthreadid()]
51-
fstar2_L_threaded = A3dp1_y[A3dp1_y(undef, nvariables(equations), nnodes(dg),
52-
nnodes(dg) + 1)
53-
for _ in 1:Threads.maxthreadid()]
54-
fstar2_R_threaded = A3dp1_y[A3dp1_y(undef, nvariables(equations), nnodes(dg),
55-
nnodes(dg) + 1)
56-
for _ in 1:Threads.maxthreadid()]
44+
A3d = Array{uEltype, 3}
45+
46+
fstar1_L_threaded = A3d[A3d(undef, nvariables(equations),
47+
nnodes(dg) + 1, nnodes(dg))
48+
for _ in 1:Threads.maxthreadid()]
49+
fstar1_R_threaded = A3d[A3d(undef, nvariables(equations),
50+
nnodes(dg) + 1, nnodes(dg))
51+
for _ in 1:Threads.maxthreadid()]
52+
fstar2_L_threaded = A3d[A3d(undef, nvariables(equations),
53+
nnodes(dg), nnodes(dg) + 1)
54+
for _ in 1:Threads.maxthreadid()]
55+
fstar2_R_threaded = A3d[A3d(undef, nvariables(equations),
56+
nnodes(dg), nnodes(dg) + 1)
57+
for _ in 1:Threads.maxthreadid()]
5758

5859
return (; cache...,
5960
fstar1_L_threaded, fstar1_R_threaded, fstar2_L_threaded, fstar2_R_threaded)
@@ -63,19 +64,20 @@ function create_cache(mesh::Union{TreeMesh{2}, StructuredMesh{2}, UnstructuredMe
6364
P4estMesh{2}, T8codeMesh{2}}, equations,
6465
volume_integral::VolumeIntegralPureLGLFiniteVolume, dg::DG,
6566
uEltype)
66-
A3dp1_x = Array{uEltype, 3}
67-
A3dp1_y = Array{uEltype, 3}
68-
69-
fstar1_L_threaded = A3dp1_x[A3dp1_x(undef, nvariables(equations), nnodes(dg) + 1,
70-
nnodes(dg)) for _ in 1:Threads.maxthreadid()]
71-
fstar1_R_threaded = A3dp1_x[A3dp1_x(undef, nvariables(equations), nnodes(dg) + 1,
72-
nnodes(dg)) for _ in 1:Threads.maxthreadid()]
73-
fstar2_L_threaded = A3dp1_y[A3dp1_y(undef, nvariables(equations), nnodes(dg),
74-
nnodes(dg) + 1)
75-
for _ in 1:Threads.maxthreadid()]
76-
fstar2_R_threaded = A3dp1_y[A3dp1_y(undef, nvariables(equations), nnodes(dg),
77-
nnodes(dg) + 1)
78-
for _ in 1:Threads.maxthreadid()]
67+
A3d = Array{uEltype, 3}
68+
69+
fstar1_L_threaded = A3d[A3d(undef, nvariables(equations),
70+
nnodes(dg) + 1, nnodes(dg))
71+
for _ in 1:Threads.maxthreadid()]
72+
fstar1_R_threaded = A3d[A3d(undef, nvariables(equations),
73+
nnodes(dg) + 1, nnodes(dg))
74+
for _ in 1:Threads.maxthreadid()]
75+
fstar2_L_threaded = A3d[A3d(undef, nvariables(equations),
76+
nnodes(dg), nnodes(dg) + 1)
77+
for _ in 1:Threads.maxthreadid()]
78+
fstar2_R_threaded = A3d[A3d(undef, nvariables(equations),
79+
nnodes(dg), nnodes(dg) + 1)
80+
for _ in 1:Threads.maxthreadid()]
7981

8082
return (; fstar1_L_threaded, fstar1_R_threaded, fstar2_L_threaded,
8183
fstar2_R_threaded)

src/solvers/dgsem_tree/dg_2d_subcell_limiters.jl

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,35 @@ function create_cache(mesh::Union{TreeMesh{2}, StructuredMesh{2}, P4estMesh{2}},
1212
VolumeIntegralPureLGLFiniteVolume(volume_integral.volume_flux_fv),
1313
dg, uEltype)
1414

15-
A3dp1_x = Array{uEltype, 3}
16-
A3dp1_y = Array{uEltype, 3}
1715
A3d = Array{uEltype, 3}
18-
A4d = Array{uEltype, 4}
19-
20-
fhat1_L_threaded = A3dp1_x[A3dp1_x(undef, nvariables(equations), nnodes(dg) + 1,
21-
nnodes(dg)) for _ in 1:Threads.maxthreadid()]
22-
fhat2_L_threaded = A3dp1_y[A3dp1_y(undef, nvariables(equations), nnodes(dg),
23-
nnodes(dg) + 1) for _ in 1:Threads.maxthreadid()]
24-
fhat1_R_threaded = A3dp1_x[A3dp1_x(undef, nvariables(equations), nnodes(dg) + 1,
25-
nnodes(dg)) for _ in 1:Threads.maxthreadid()]
26-
fhat2_R_threaded = A3dp1_y[A3dp1_y(undef, nvariables(equations), nnodes(dg),
27-
nnodes(dg) + 1) for _ in 1:Threads.maxthreadid()]
28-
flux_temp_threaded = A3d[A3d(undef, nvariables(equations), nnodes(dg), nnodes(dg))
16+
17+
fhat1_L_threaded = A3d[A3d(undef, nvariables(equations),
18+
nnodes(dg) + 1, nnodes(dg))
19+
for _ in 1:Threads.maxthreadid()]
20+
fhat2_L_threaded = A3d[A3d(undef, nvariables(equations),
21+
nnodes(dg), nnodes(dg) + 1)
22+
for _ in 1:Threads.maxthreadid()]
23+
fhat1_R_threaded = A3d[A3d(undef, nvariables(equations),
24+
nnodes(dg) + 1, nnodes(dg))
25+
for _ in 1:Threads.maxthreadid()]
26+
fhat2_R_threaded = A3d[A3d(undef, nvariables(equations),
27+
nnodes(dg), nnodes(dg) + 1)
28+
for _ in 1:Threads.maxthreadid()]
29+
30+
flux_temp_threaded = A3d[A3d(undef, nvariables(equations),
31+
nnodes(dg), nnodes(dg))
2932
for _ in 1:Threads.maxthreadid()]
30-
fhat_temp_threaded = A3d[A3d(undef, nvariables(equations), nnodes(dg),
31-
nnodes(dg))
33+
fhat_temp_threaded = A3d[A3d(undef, nvariables(equations),
34+
nnodes(dg), nnodes(dg))
3235
for _ in 1:Threads.maxthreadid()]
36+
3337
antidiffusive_fluxes = ContainerAntidiffusiveFlux2D{uEltype}(0,
3438
nvariables(equations),
3539
nnodes(dg))
3640

3741
if have_nonconservative_terms(equations) == true
42+
A4d = Array{uEltype, 4}
43+
3844
# Extract the nonconservative flux as a dispatch argument for `n_nonconservative_terms`
3945
_, volume_flux_noncons = volume_integral.volume_flux_dg
4046

src/solvers/dgsem_tree/dg_3d.jl

Lines changed: 38 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,25 @@ function create_cache(mesh::Union{TreeMesh{3}, StructuredMesh{3}, P4estMesh{3},
1616
VolumeIntegralFluxDifferencing(volume_integral.volume_flux_dg),
1717
dg, uEltype)
1818

19-
A4dp1_x = Array{uEltype, 4}
20-
A4dp1_y = Array{uEltype, 4}
21-
A4dp1_z = Array{uEltype, 4}
22-
fstar1_L_threaded = A4dp1_x[A4dp1_x(undef, nvariables(equations), nnodes(dg) + 1,
23-
nnodes(dg), nnodes(dg))
24-
for _ in 1:Threads.maxthreadid()]
25-
fstar1_R_threaded = A4dp1_x[A4dp1_x(undef, nvariables(equations), nnodes(dg) + 1,
26-
nnodes(dg), nnodes(dg))
27-
for _ in 1:Threads.maxthreadid()]
28-
fstar2_L_threaded = A4dp1_y[A4dp1_y(undef, nvariables(equations), nnodes(dg),
29-
nnodes(dg) + 1, nnodes(dg))
30-
for _ in 1:Threads.maxthreadid()]
31-
fstar2_R_threaded = A4dp1_y[A4dp1_y(undef, nvariables(equations), nnodes(dg),
32-
nnodes(dg) + 1, nnodes(dg))
33-
for _ in 1:Threads.maxthreadid()]
34-
fstar3_L_threaded = A4dp1_z[A4dp1_z(undef, nvariables(equations), nnodes(dg),
35-
nnodes(dg), nnodes(dg) + 1)
36-
for _ in 1:Threads.maxthreadid()]
37-
fstar3_R_threaded = A4dp1_z[A4dp1_z(undef, nvariables(equations), nnodes(dg),
38-
nnodes(dg), nnodes(dg) + 1)
39-
for _ in 1:Threads.maxthreadid()]
19+
A4d = Array{uEltype, 4}
20+
fstar1_L_threaded = A4d[A4d(undef, nvariables(equations),
21+
nnodes(dg) + 1, nnodes(dg), nnodes(dg))
22+
for _ in 1:Threads.maxthreadid()]
23+
fstar1_R_threaded = A4d[A4d(undef, nvariables(equations),
24+
nnodes(dg) + 1, nnodes(dg), nnodes(dg))
25+
for _ in 1:Threads.maxthreadid()]
26+
fstar2_L_threaded = A4d[A4d(undef, nvariables(equations),
27+
nnodes(dg), nnodes(dg) + 1, nnodes(dg))
28+
for _ in 1:Threads.maxthreadid()]
29+
fstar2_R_threaded = A4d[A4d(undef, nvariables(equations),
30+
nnodes(dg), nnodes(dg) + 1, nnodes(dg))
31+
for _ in 1:Threads.maxthreadid()]
32+
fstar3_L_threaded = A4d[A4d(undef, nvariables(equations),
33+
nnodes(dg), nnodes(dg), nnodes(dg) + 1)
34+
for _ in 1:Threads.maxthreadid()]
35+
fstar3_R_threaded = A4d[A4d(undef, nvariables(equations),
36+
nnodes(dg), nnodes(dg), nnodes(dg) + 1)
37+
for _ in 1:Threads.maxthreadid()]
4038

4139
return (; cache..., fstar1_L_threaded, fstar1_R_threaded,
4240
fstar2_L_threaded, fstar2_R_threaded, fstar3_L_threaded, fstar3_R_threaded)
@@ -46,27 +44,25 @@ function create_cache(mesh::Union{TreeMesh{3}, StructuredMesh{3}, P4estMesh{3},
4644
T8codeMesh{3}}, equations,
4745
volume_integral::VolumeIntegralPureLGLFiniteVolume, dg::DG,
4846
uEltype)
49-
A4dp1_x = Array{uEltype, 4}
50-
A4dp1_y = Array{uEltype, 4}
51-
A4dp1_z = Array{uEltype, 4}
52-
fstar1_L_threaded = A4dp1_x[A4dp1_x(undef, nvariables(equations), nnodes(dg) + 1,
53-
nnodes(dg), nnodes(dg))
54-
for _ in 1:Threads.maxthreadid()]
55-
fstar1_R_threaded = A4dp1_x[A4dp1_x(undef, nvariables(equations), nnodes(dg) + 1,
56-
nnodes(dg), nnodes(dg))
57-
for _ in 1:Threads.maxthreadid()]
58-
fstar2_L_threaded = A4dp1_y[A4dp1_y(undef, nvariables(equations), nnodes(dg),
59-
nnodes(dg) + 1, nnodes(dg))
60-
for _ in 1:Threads.maxthreadid()]
61-
fstar2_R_threaded = A4dp1_y[A4dp1_y(undef, nvariables(equations), nnodes(dg),
62-
nnodes(dg) + 1, nnodes(dg))
63-
for _ in 1:Threads.maxthreadid()]
64-
fstar3_L_threaded = A4dp1_z[A4dp1_z(undef, nvariables(equations), nnodes(dg),
65-
nnodes(dg), nnodes(dg) + 1)
66-
for _ in 1:Threads.maxthreadid()]
67-
fstar3_R_threaded = A4dp1_z[A4dp1_z(undef, nvariables(equations), nnodes(dg),
68-
nnodes(dg), nnodes(dg) + 1)
69-
for _ in 1:Threads.maxthreadid()]
47+
A4d = Array{uEltype, 4}
48+
fstar1_L_threaded = A4d[A4d(undef, nvariables(equations), nnodes(dg) + 1,
49+
nnodes(dg), nnodes(dg))
50+
for _ in 1:Threads.maxthreadid()]
51+
fstar1_R_threaded = A4d[A4d(undef, nvariables(equations), nnodes(dg) + 1,
52+
nnodes(dg), nnodes(dg))
53+
for _ in 1:Threads.maxthreadid()]
54+
fstar2_L_threaded = A4d[A4d(undef, nvariables(equations), nnodes(dg),
55+
nnodes(dg) + 1, nnodes(dg))
56+
for _ in 1:Threads.maxthreadid()]
57+
fstar2_R_threaded = A4d[A4d(undef, nvariables(equations), nnodes(dg),
58+
nnodes(dg) + 1, nnodes(dg))
59+
for _ in 1:Threads.maxthreadid()]
60+
fstar3_L_threaded = A4d[A4d(undef, nvariables(equations), nnodes(dg),
61+
nnodes(dg), nnodes(dg) + 1)
62+
for _ in 1:Threads.maxthreadid()]
63+
fstar3_R_threaded = A4d[A4d(undef, nvariables(equations), nnodes(dg),
64+
nnodes(dg), nnodes(dg) + 1)
65+
for _ in 1:Threads.maxthreadid()]
7066

7167
return (; fstar1_L_threaded, fstar1_R_threaded, fstar2_L_threaded,
7268
fstar2_R_threaded,

0 commit comments

Comments
 (0)