Skip to content

Commit a486ae0

Browse files
author
Martin D. Weinberg
committed
White-space changes only for readability
1 parent 2f3d782 commit a486ae0

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

utils/PhaseSpace/hdf5bods.cc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Draft EXP ascii particle phase-space data HDF5 converter
2+
EXP ascii particle phase-space data HDF5 converter
33
44
This is a possible template for implementing HDF5 input files for
55
EXP. The code reads an ASCII file with particle data and writes it to
@@ -128,9 +128,10 @@ void parse_particle_line(const std::string& line,
128128
T val;
129129

130130
// Parse core PSP fields
131-
if (!(iss >> data.m[particle_idx]
132-
>> data.x[particle_idx] >> data.y[particle_idx] >> data.z[particle_idx]
133-
>> data.u[particle_idx] >> data.v[particle_idx] >> data.w[particle_idx])) {
131+
if (!(iss
132+
>> data.m[particle_idx]
133+
>> data.x[particle_idx] >> data.y[particle_idx] >> data.z[particle_idx]
134+
>> data.u[particle_idx] >> data.v[particle_idx] >> data.w[particle_idx])) {
134135
throw std::runtime_error("Failed to parse core fields at particle " +
135136
std::to_string(particle_idx));
136137
}
@@ -271,7 +272,8 @@ void ascii_to_hdf5_impl(const std::string& ascii_file,
271272
// Define compression filters
272273
DataSetCreateProps props;
273274
hsize_t chunk = static_cast<hsize_t>(std::max(num_particles / 10, 1024));
274-
if (chunk > static_cast<hsize_t>(num_particles)) chunk = static_cast<hsize_t>(num_particles);
275+
if (chunk > static_cast<hsize_t>(num_particles))
276+
chunk = static_cast<hsize_t>(num_particles);
275277
props.add(Chunking(std::vector<hsize_t>{chunk}));
276278
props.add(Shuffle());
277279
props.add(Deflate(4)); // This is a good compromise between
@@ -391,9 +393,11 @@ ParticleDataVariant read_hdf5_data(const std::string& hdf5_file)
391393

392394
// Read core PSP fields
393395
data.m = read_dataset("m");
396+
394397
data.x = read_dataset("x");
395398
data.y = read_dataset("y");
396399
data.z = read_dataset("z");
400+
397401
data.u = read_dataset("u");
398402
data.v = read_dataset("v");
399403
data.w = read_dataset("w");

0 commit comments

Comments
 (0)