Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dg
dg
Commits
723ffc93
Commit
723ffc93
authored
Oct 24, 2016
by
Valentin Vallaeys
Browse files
updated offline testcase
parent
e3ee8d75
Pipeline
#1205
passed with stage
in 31 minutes and 29 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
dgpy/scripts/slim.py
View file @
723ffc93
...
@@ -556,7 +556,7 @@ class ShallowWaterTracer2d:
...
@@ -556,7 +556,7 @@ class ShallowWaterTracer2d:
Format:
Format:
- equation : ShallowWater2d object (online mode)
- equation : ShallowWater2d object (online mode)
- string : path to the folder containing the hydrodynamics (offline mode).
- string : path to the folder containing the hydrodynamics
folder 'offline_sw2d'
(offline mode).
* linear_equation
* linear_equation
boolean stating linear shallow water tracer equation (default: False)
boolean stating linear shallow water tracer equation (default: False)
* name
* name
...
...
modules/shallowWater/tests/offline/test.py
View file @
723ffc93
...
@@ -75,14 +75,16 @@ loop.add_equation(eq)
...
@@ -75,14 +75,16 @@ loop.add_equation(eq)
loop
.
add_equation
(
eq2
)
loop
.
add_equation
(
eq2
)
loop
.
run
()
loop
.
run
()
eq3
=
slim
.
ShallowWaterTracer2d
(
domain
,
"implicit"
,
'./output'
,
name
=
"tracer_offline"
,
offline
=
True
,
initial_time
=
0
,
final_time
=
nbSteps
*
dt
)
n_restart
=
25
eq3
=
slim
.
ShallowWaterTracer2d
(
domain
,
"implicit"
,
'./output'
,
name
=
"tracer_offline"
,
offline
=
True
,
initial_time
=
n_restart
*
dt
,
final_time
=
nbSteps
*
dt
)
eq3
.
set_initial_condition
((
"tracer_CI.nc"
,
"CI"
))
eq3
.
set_initial_condition
((
"tracer_CI.nc"
,
"CI"
))
eq3
.
set_diffusivity
(
"okubo"
,
okubo_coefficient
=
0.0
)
eq3
.
set_diffusivity
(
"okubo"
,
okubo_coefficient
=
0.0
)
eq3
.
set_boundary_coast
(
"Wall"
)
eq3
.
set_boundary_coast
(
"Wall"
)
eq3
.
compute_mass
(
"tracer.dat"
)
eq3
.
compute_mass
(
"tracer.dat"
)
loop2
=
slim
.
Loop
(
maximum_time_step
=
dt
,
export_time
=
dt
,
path
=
"./output"
)
loop2
=
slim
.
Loop
(
maximum_time_step
=
dt
,
export_time
=
dt
,
path
=
"./output"
)
loop2
.
set_time_step_offline
(
dt
,
periodic
=
False
,
index_start
=
1
,
n_index_per_period
=-
1
)
loop2
.
set_time_step_offline
(
dt
,
periodic
=
False
,
index_start
=
n_restart
,
n_index_per_period
=-
1
)
loop2
.
add_equation
(
eq3
)
loop2
.
add_equation
(
eq3
)
loop2
.
run
()
loop2
.
run
()
...
@@ -105,4 +107,6 @@ print("L2 error on tracer: %e\n" % error)
...
@@ -105,4 +107,6 @@ print("L2 error on tracer: %e\n" % error)
if
(
error
>
1e-12
):
if
(
error
>
1e-12
):
dgpy
.
Msg
.
Error
(
"Error is too high"
);
dgpy
.
Msg
.
Error
(
"Error is too high"
);
dgpy
.
Msg
.
Exit
(
1
)
dgpy
.
Msg
.
Exit
(
1
)
else
:
dgpy
.
Msg
.
Info
(
"Test succeeded"
);
dgpy
.
Msg
.
Exit
(
0
)
dgpy
.
Msg
.
Exit
(
0
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment