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
3e488108
Commit
3e488108
authored
Feb 05, 2019
by
Cristian Lalescu
Browse files
fix sampling file space error
parent
96e9436e
Pipeline
#43348
canceled with stage
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bfps/DNS.py
View file @
3e488108
...
...
@@ -784,10 +784,15 @@ class DNS(_code):
def
generate_tracer_state
(
self
,
rseed
=
None
,
species
=
0
):
species
=
0
,
integration_steps
=
None
,
ncomponents
=
3
):
try
:
ncomponents
=
3
if
self
.
dns_type
in
[
'NSVEcomplex_particles'
]:
if
type
(
integration_steps
)
==
type
(
None
):
integration_steps
=
self
.
NSVEp_extra_parameters
[
'tracers0_integration_steps'
]
if
'tracers{0}_integration_steps'
.
format
(
species
)
in
self
.
parameters
.
keys
():
integration_steps
=
self
.
parameters
[
'tracers{0}_integration_steps'
.
format
(
species
)]
if
self
.
dns_type
==
'NSVEcomplex_particles'
and
species
==
0
:
ncomponents
=
6
with
h5py
.
File
(
self
.
get_checkpoint_0_fname
(),
'a'
)
as
data_file
:
nn
=
self
.
parameters
[
'nparticles'
]
...
...
@@ -797,9 +802,7 @@ class DNS(_code):
data_file
.
create_group
(
'tracers{0}/state'
.
format
(
species
))
data_file
[
'tracers{0}/rhs'
.
format
(
species
)].
create_dataset
(
'0'
,
shape
=
(
(
self
.
parameters
[
'tracers{0}_integration_steps'
.
format
(
species
)],)
+
(
nn
,
ncomponents
,)),
shape
=
(
integration_steps
,
nn
,
ncomponents
,),
dtype
=
np
.
float
)
dset
=
data_file
[
'tracers{0}/state'
.
format
(
species
)].
create_dataset
(
'0'
,
...
...
bfps/cpp/full_code/NSVEparticles.cpp
View file @
3e488108
//#define NDEBUG
/**********************************************************************
* *
* Copyright 2019 Max Planck Institute *
* for Dynamics and Self-Organization *
* *
* This file is part of bfps. *
* *
* bfps is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published *
* by the Free Software Foundation, either version 3 of the License, *
* or (at your option) any later version. *
* *
* bfps is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with bfps. If not, see <http://www.gnu.org/licenses/> *
* *
* Contact: Cristian.Lalescu@ds.mpg.de *
* *
**********************************************************************/
#define NDEBUG
#include
<string>
#include
<cmath>
...
...
bfps/cpp/particles/particles_output_hdf5.hpp
View file @
3e488108
...
...
@@ -242,6 +242,7 @@ public:
variable_used_only_in_assert
(
rethdf
);
assert
(
rethdf
>=
0
);
DEBUG_MSG
(
"before writing state
\n
"
);
herr_t
status
=
H5Dwrite
(
dataset_id
,
type_id
,
...
...
@@ -257,6 +258,7 @@ public:
assert
(
rethdf
>=
0
);
rethdf
=
H5Sclose
(
filespace
);
assert
(
rethdf
>=
0
);
DEBUG_MSG
(
"after writing state
\n
"
);
}
{
assert
(
size_particle_rhs
>=
0
);
...
...
@@ -304,6 +306,7 @@ public:
variable_used_only_in_assert
(
rethdf
);
assert
(
rethdf
>=
0
);
DEBUG_MSG
(
"before writing rhs %d
\n
"
,
idx_rhs
);
herr_t
status
=
H5Dwrite
(
dataset_id
,
type_id
,
...
...
@@ -317,6 +320,7 @@ public:
assert
(
rethdf
>=
0
);
rethdf
=
H5Sclose
(
memspace
);
assert
(
rethdf
>=
0
);
DEBUG_MSG
(
"after writing rhs %d
\n
"
,
idx_rhs
);
}
int
rethdf
=
H5Dclose
(
dataset_id
);
variable_used_only_in_assert
(
rethdf
);
...
...
bfps/cpp/particles/particles_output_sampling_hdf5.hpp
View file @
3e488108
...
...
@@ -216,7 +216,7 @@ public:
hid_t
memspace
=
H5Screate_simple
(
2
,
count
,
NULL
);
assert
(
memspace
>=
0
);
const
hsize_t
file_count
[
2
]
=
{
hsize_t
(
Parent
::
getTotalNbParticles
()),
size_particle_
position
s
};
const
hsize_t
file_count
[
2
]
=
{
hsize_t
(
Parent
::
getTotalNbParticles
()),
size_particle_
rh
s
};
hid_t
filespace
=
H5Screate_simple
(
2
,
file_count
,
NULL
);
assert
(
filespace
>=
0
);
int
rethdf
=
H5Sselect_hyperslab
(
...
...
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