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
TurTLE
TurTLE
Commits
1e5b4b13
Commit
1e5b4b13
authored
Jan 22, 2020
by
Cristian Lalescu
Browse files
use particle information for checkpointing
parent
da7480f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
cpp/full_code/kraichnan_field.cpp
View file @
1e5b4b13
...
...
@@ -327,14 +327,23 @@ void kraichnan_field<rnumber>::update_checkpoint()
hsize_t
fields_stored
;
hid_t
fid
,
group_id
;
fid
=
H5Fopen
(
fname
.
c_str
(),
H5F_ACC_RDONLY
,
H5P_DEFAULT
);
group_id
=
H5Gopen
(
fid
,
"velocity/real"
,
H5P_DEFAULT
);
H5Gget_num_objs
(
group_id
=
H5Gopen
(
fid
,
"tracers0/state"
,
H5P_DEFAULT
);
bool
dset_exists
;
if
(
group_id
>
0
)
{
H5Gget_num_objs
(
group_id
,
&
fields_stored
);
bool
dset_exists
=
H5Lexists
(
dset_exists
=
H5Lexists
(
group_id
,
std
::
to_string
(
this
->
iteration
).
c_str
(),
H5P_DEFAULT
);
}
else
{
fields_stored
=
0
;
dset_exists
=
false
;
}
H5Gclose
(
group_id
);
H5Fclose
(
fid
);
if
((
int
(
fields_stored
)
>=
this
->
checkpoints_per_file
)
&&
...
...
@@ -351,13 +360,13 @@ void kraichnan_field<rnumber>::update_checkpoint()
H5P_DEFAULT
);
hid_t
gg
=
H5Gcreate
(
fid
,
"
velocity
"
,
"
tracers0
"
,
H5P_DEFAULT
,
H5P_DEFAULT
,
H5P_DEFAULT
);
hid_t
ggg
=
H5Gcreate
(
gg
,
"
real
"
,
"
state
"
,
H5P_DEFAULT
,
H5P_DEFAULT
,
H5P_DEFAULT
);
...
...
Write
Preview
Markdown
is supported
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