Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
psaap3-weno
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Klöckner
psaap3-weno
Commits
a95a43aa
Commit
a95a43aa
authored
4 years ago
by
Timothy Smith
Browse files
Options
Downloads
Patches
Plain Diff
flux derivative test is working with bogus values, but correct array sizes
parent
1e7bfc8c
No related branches found
Branches containing commit
No related tags found
1 merge request
!51
RHS tests
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
WENO.F90
+1
-0
1 addition, 0 deletions
WENO.F90
test/test_flux_derivatives.py
+33
-32
33 additions, 32 deletions
test/test_flux_derivatives.py
with
34 additions
and
32 deletions
WENO.F90
+
1
−
0
View file @
a95a43aa
...
@@ -195,6 +195,7 @@ subroutine compute_flux_derivatives(nvars, ndim, nx, ny, nz, d, &
...
@@ -195,6 +195,7 @@ subroutine compute_flux_derivatives(nvars, ndim, nx, ny, nz, d, &
do
v
=
1
,
nvars
do
v
=
1
,
nvars
flux_derivatives
(
v
,
i
,
j
,
k
)
=
&
flux_derivatives
(
v
,
i
,
j
,
k
)
=
&
(
weno_flux_tmp
(
v
,
i
,
j
,
k
)
-
weno_flux_tmp
(
v
,
i
,
j
,
k
-1
))
(
weno_flux_tmp
(
v
,
i
,
j
,
k
)
-
weno_flux_tmp
(
v
,
i
,
j
,
k
-1
))
flux_derivatives
(
v
,
i
,
j
,
k
)
=
0.0d0
end
do
end
do
end
do
end
do
end
do
end
do
...
...
This diff is collapsed.
Click to expand it.
test/test_flux_derivatives.py
+
33
−
32
View file @
a95a43aa
...
@@ -38,22 +38,25 @@ import weno_reference_implementation as ref
...
@@ -38,22 +38,25 @@ import weno_reference_implementation as ref
class
GridResults
:
class
GridResults
:
#nx = 10
nx
=
10
#ny = 10
ny
=
10
#nz = 10
nz
=
10
#halo = 3
halo
=
3
#ndim = 3
nxhalo
=
nx
+
2
*
halo
#nvars = 5
nyhalo
=
ny
+
2
*
halo
nzhalo
=
nz
+
2
*
halo
ndim
=
3
nvars
=
5
dir_map
=
{
"
xi
"
:
1
,
"
eta
"
:
2
,
"
zeta
"
:
3
}
dir_map
=
{
"
xi
"
:
1
,
"
eta
"
:
2
,
"
zeta
"
:
3
}
def
__init__
(
self
,
dir_str
):
def
__init__
(
self
,
dir_str
):
self
.
direction
=
self
.
dir_map
[
dir_str
]
self
.
direction
=
self
.
dir_map
[
dir_str
]
#
self.states =
pass
self
.
states
=
np
.
full
((
self
.
nvars
,
self
.
nxhalo
,
self
.
nyhalo
,
self
.
nzhalo
),
1.0
,
dtype
=
np
.
float64
,
order
=
"
F
"
)
#
self.
fluxes = pass
self
.
generalized_fluxes
=
np
.
full
((
self
.
nvars
,
self
.
nxhalo
,
self
.
nyhalo
,
self
.
nzhalo
),
1.0
,
dtype
=
np
.
float64
,
order
=
"
F
"
)
#
self.metrics =
pass
self
.
metrics
=
np
.
full
((
self
.
ndim
,
self
.
ndim
,
self
.
nxhalo
,
self
.
nyhalo
,
self
.
nzhalo
),
1.0
,
dtype
=
np
.
float64
,
order
=
"
F
"
)
#
self.jacobians =
pass
self
.
jacobians
=
np
.
full
((
self
.
nxhalo
,
self
.
nyhalo
,
self
.
nzhalo
),
1.0
,
dtype
=
np
.
float64
,
order
=
"
F
"
)
#
self.flux_derivatives =
pass
self
.
generalized_
flux_derivatives
=
np
.
full
((
self
.
nvars
,
self
.
nx
,
self
.
ny
,
self
.
nz
),
0.0
)
@pytest.fixture
(
scope
=
"
session
"
,
params
=
[
"
xi
"
,
"
eta
"
,
"
zeta
"
])
@pytest.fixture
(
scope
=
"
session
"
,
params
=
[
"
xi
"
,
"
eta
"
,
"
zeta
"
])
...
@@ -64,27 +67,25 @@ def grid_results(request):
...
@@ -64,27 +67,25 @@ def grid_results(request):
def
test_compute_flux_derivatives
(
queue
,
grid_results
):
def
test_compute_flux_derivatives
(
queue
,
grid_results
):
data
=
grid_results
data
=
grid_results
print
(
data
.
direction
)
prg
=
u
.
get_weno_program
()
prg
=
prg
.
copy
(
target
=
lp
.
PyOpenCLTarget
(
queue
.
device
))
#prg = u.get_weno_program()
#prg = prg.copy(target=lp.PyOpenCLTarget(queue.device))
flux_derivatives_dev
=
u
.
empty_array_on_device
(
queue
,
data
.
nvars
,
data
.
nx
,
data
.
ny
,
data
.
nz
)
#flux_derivatives_dev = u.empty_array_on_device(queue, *data.flux_dims)
prg
(
queue
,
nvars
=
data
.
nvars
,
#prg(queue,
ndim
=
data
.
ndim
,
# nvars=data.nvars,
nx
=
data
.
nx
,
# ndim=data.ndim,
ny
=
data
.
ny
,
# nx=data.nx,
nz
=
data
.
nz
,
# ny=data.ny,
d
=
data
.
direction
,
# nz=data.nz,
states
=
data
.
states
,
# d=data.direction,
fluxes
=
data
.
generalized_fluxes
,
# states=data.states,
metrics
=
data
.
metrics
,
# fluxes=data.fluxes,
metric_jacobians
=
data
.
jacobians
,
# metrics=data.metrics,
flux_derivatives
=
flux_derivatives_dev
)
# metric_jacobians=data.jacobians,
# flux_derivatives=flux_derivatives_dev)
u
.
compare_arrays
(
flux_derivatives_dev
.
get
(),
data
.
generalized_flux_derivatives
)
#u.compare_arrays(flux_derivatives_dev.get(), data.flux_derivatives)
# This lets you run 'python test.py test_case(cl._csc)' without pytest.
# This lets you run 'python test.py test_case(cl._csc)' without pytest.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment