/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2013,2014,2015,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include <algorithm>
#include <iterator>
#include <memory>
+#include <numeric>
#include <vector>
#if GMX_USE_TNG
# if GMX_DOUBLE
precisionString = " (double precision)";
# endif
- sprintf(programInfo, "%.100s %.128s%.24s", gmx::getProgramContext().displayName(),
- gmx_version(), precisionString);
+ sprintf(programInfo, "%.100s %.128s%.24s", gmx::getProgramContext().displayName(), gmx_version(), precisionString);
if (mode == 'w')
{
tng_first_program_name_set(*tng, programInfo);
* number the latter should be used. Wait for TNG 2.0*/
tng_chain_residue_add(tng, tngChain, *resInfo->name, &tngRes);
}
- tng_residue_atom_add(tng, tngRes, *(atoms->atomname[atomIndex]),
- *(atoms->atomtype[atomIndex]), &tngAtom);
+ tng_residue_atom_add(
+ tng, tngRes, *(atoms->atomname[atomIndex]), *(atoms->atomtype[atomIndex]), &tngAtom);
}
}
tng_molecule_cnt_set(tng, *tngMol, numMolecules);
}
for (int molCounter = 1; molCounter < molBlock.nmol; molCounter++)
{
- std::copy_n(atomCharges.end() - molType->atoms.nr, molType->atoms.nr,
+ std::copy_n(atomCharges.end() - molType->atoms.nr,
+ molType->atoms.nr,
std::back_inserter(atomCharges));
- std::copy_n(atomMasses.end() - molType->atoms.nr, molType->atoms.nr,
- std::back_inserter(atomMasses));
+ std::copy_n(atomMasses.end() - molType->atoms.nr, molType->atoms.nr, std::back_inserter(atomMasses));
}
}
/* Write the TNG data blocks. */
- tng_particle_data_block_add(tng, TNG_TRAJ_PARTIAL_CHARGES, "PARTIAL CHARGES", datatype,
- TNG_NON_TRAJECTORY_BLOCK, 1, 1, 1, 0, mtop->natoms,
- TNG_GZIP_COMPRESSION, atomCharges.data());
- tng_particle_data_block_add(tng, TNG_TRAJ_MASSES, "ATOM MASSES", datatype, TNG_NON_TRAJECTORY_BLOCK,
- 1, 1, 1, 0, mtop->natoms, TNG_GZIP_COMPRESSION, atomMasses.data());
+ tng_particle_data_block_add(tng,
+ TNG_TRAJ_PARTIAL_CHARGES,
+ "PARTIAL CHARGES",
+ datatype,
+ TNG_NON_TRAJECTORY_BLOCK,
+ 1,
+ 1,
+ 1,
+ 0,
+ mtop->natoms,
+ TNG_GZIP_COMPRESSION,
+ atomCharges.data());
+ tng_particle_data_block_add(tng,
+ TNG_TRAJ_MASSES,
+ "ATOM MASSES",
+ datatype,
+ TNG_NON_TRAJECTORY_BLOCK,
+ 1,
+ 1,
+ 1,
+ 0,
+ mtop->natoms,
+ TNG_GZIP_COMPRESSION,
+ atomMasses.data());
}
/*! \libinternal \brief Compute greatest common divisor of n1 and n2
}
/* We have a non-trivial greatest common divisor to compute. */
- return gmx_greatest_common_divisor(n1, n2);
+ return std::gcd(n1, n2);
}
/* By default try to write 100 frames (of actual output) in each frame set.
/* Define pointers to specific writing functions depending on if we
* write float or double data */
typedef tng_function_status (*set_writing_interval_func_pointer)(
- tng_trajectory_t, const int64_t, const int64_t, const int64_t, const char*, const char,
- const char);
+ tng_trajectory_t, const int64_t, const int64_t, const int64_t, const char*, const char, const char);
# if GMX_DOUBLE
set_writing_interval_func_pointer set_writing_interval = tng_util_generic_write_interval_double_set;
# else
}
if (xout)
{
- set_writing_interval(tng, xout, 3, TNG_TRAJ_POSITIONS, "POSITIONS", TNG_PARTICLE_BLOCK_DATA,
- compression);
+ set_writing_interval(
+ tng, xout, 3, TNG_TRAJ_POSITIONS, "POSITIONS", TNG_PARTICLE_BLOCK_DATA, compression);
/* TODO: if/when we write energies to TNG also, reconsider how
* and when box information is written, because GROMACS
* behaviour pre-5.0 was to write the box with every
}
if (vout)
{
- set_writing_interval(tng, vout, 3, TNG_TRAJ_VELOCITIES, "VELOCITIES",
- TNG_PARTICLE_BLOCK_DATA, compression);
+ set_writing_interval(
+ tng, vout, 3, TNG_TRAJ_VELOCITIES, "VELOCITIES", TNG_PARTICLE_BLOCK_DATA, compression);
gcd = greatest_common_divisor_if_positive(gcd, vout);
if (lowest < 0 || vout < lowest)
}
if (fout)
{
- set_writing_interval(tng, fout, 3, TNG_TRAJ_FORCES, "FORCES", TNG_PARTICLE_BLOCK_DATA,
- TNG_GZIP_COMPRESSION);
+ set_writing_interval(
+ tng, fout, 3, TNG_TRAJ_FORCES, "FORCES", TNG_PARTICLE_BLOCK_DATA, TNG_GZIP_COMPRESSION);
gcd = greatest_common_divisor_if_positive(gcd, fout);
if (lowest < 0 || fout < lowest)
{
/* Lambdas and box shape written at an interval of the lowest common
denominator of other output */
- set_writing_interval(tng, gcd, 1, TNG_GMX_LAMBDA, "LAMBDAS", TNG_NON_PARTICLE_BLOCK_DATA,
- TNG_GZIP_COMPRESSION);
+ set_writing_interval(
+ tng, gcd, 1, TNG_GMX_LAMBDA, "LAMBDAS", TNG_NON_PARTICLE_BLOCK_DATA, TNG_GZIP_COMPRESSION);
- set_writing_interval(tng, gcd, 9, TNG_TRAJ_BOX_SHAPE, "BOX SHAPE",
- TNG_NON_PARTICLE_BLOCK_DATA, TNG_GZIP_COMPRESSION);
+ set_writing_interval(
+ tng, gcd, 9, TNG_TRAJ_BOX_SHAPE, "BOX SHAPE", TNG_NON_PARTICLE_BLOCK_DATA, TNG_GZIP_COMPRESSION);
gmx_tng->lambdaOutputInterval = gcd;
gmx_tng->boxOutputInterval = gcd;
if (gcd < lowest / 10)
"The lowest common denominator of trajectory output is "
"every %d step(s), whereas the shortest output interval "
"is every %d steps.",
- gcd, lowest);
+ gcd,
+ lowest);
}
}
}
#if GMX_USE_TNG
gmx_tng_add_mtop(gmx_tng, mtop);
set_writing_intervals(gmx_tng, FALSE, ir);
- tng_time_per_frame_set(gmx_tng->tng, ir->delta_t * PICO);
+ tng_time_per_frame_set(gmx_tng->tng, ir->delta_t * gmx::c_pico);
gmx_tng->timePerFrameIsSet = true;
#else
GMX_UNUSED_VALUE(gmx_tng);
* original residue IDs - otherwise there might be conflicts. */
tng_chain_residue_add(tng, chain, res_name, &res);
}
- tng_residue_atom_w_id_add(tng, res, *(atoms->atomname[atomIndex]),
- *(atoms->atomtype[atomIndex]), atom_offset + atomIndex, &atom);
+ tng_residue_atom_w_id_add(tng,
+ res,
+ *(atoms->atomname[atomIndex]),
+ *(atoms->atomtype[atomIndex]),
+ atom_offset + atomIndex,
+ &atom);
bAtomsAdded = TRUE;
}
/* Add bonds. */
int atom1, atom2;
atom1 = ilist.iatoms[l] + atom_offset;
atom2 = ilist.iatoms[l + 1] + atom_offset;
- if (getGroupType(mtop->groups,
- SimulationAtomGroupType::CompressedPositionOutput, atom1)
+ if (getGroupType(mtop->groups, SimulationAtomGroupType::CompressedPositionOutput, atom1)
== 0
- && getGroupType(mtop->groups,
- SimulationAtomGroupType::CompressedPositionOutput, atom2)
+ && getGroupType(mtop->groups, SimulationAtomGroupType::CompressedPositionOutput, atom2)
== 0)
{
- tng_molecule_bond_add(tng, mol, ilist.iatoms[l],
- ilist.iatoms[l + 1], &tngBond);
+ tng_molecule_bond_add(
+ tng, mol, ilist.iatoms[l], ilist.iatoms[l + 1], &tngBond);
}
}
}
gmx_tng_add_mtop(gmx_tng, mtop);
add_selection_groups(gmx_tng, mtop);
set_writing_intervals(gmx_tng, TRUE, ir);
- tng_time_per_frame_set(gmx_tng->tng, ir->delta_t * PICO);
+ tng_time_per_frame_set(gmx_tng->tng, ir->delta_t * gmx::c_pico);
gmx_tng->timePerFrameIsSet = true;
gmx_tng_set_compression_precision(gmx_tng, ir->x_compression_precision);
#else
const rvec* f)
{
#if GMX_USE_TNG
- typedef tng_function_status (*write_data_func_pointer)(
- tng_trajectory_t, const int64_t, const double, const real*, const int64_t,
- const int64_t, const char*, const char, const char);
+ typedef tng_function_status (*write_data_func_pointer)(tng_trajectory_t,
+ const int64_t,
+ const double,
+ const real*,
+ const int64_t,
+ const int64_t,
+ const char*,
+ const char,
+ const char);
# if GMX_DOUBLE
static write_data_func_pointer write_data = tng_util_generic_with_time_double_write;
# else
static write_data_func_pointer write_data = tng_util_generic_with_time_write;
# endif
- double elapsedSeconds = elapsedPicoSeconds * PICO;
+ double elapsedSeconds = elapsedPicoSeconds * gmx::c_pico;
int64_t nParticles;
char compression;
{
GMX_ASSERT(box, "Need a non-NULL box if positions are written");
- if (write_data(tng, step, elapsedSeconds, reinterpret_cast<const real*>(x), 3,
- TNG_TRAJ_POSITIONS, "POSITIONS", TNG_PARTICLE_BLOCK_DATA, compression)
+ if (write_data(tng,
+ step,
+ elapsedSeconds,
+ reinterpret_cast<const real*>(x),
+ 3,
+ TNG_TRAJ_POSITIONS,
+ "POSITIONS",
+ TNG_PARTICLE_BLOCK_DATA,
+ compression)
!= TNG_SUCCESS)
{
gmx_file("Cannot write TNG trajectory frame; maybe you are out of disk space?");
if (v)
{
- if (write_data(tng, step, elapsedSeconds, reinterpret_cast<const real*>(v), 3,
- TNG_TRAJ_VELOCITIES, "VELOCITIES", TNG_PARTICLE_BLOCK_DATA, compression)
+ if (write_data(tng,
+ step,
+ elapsedSeconds,
+ reinterpret_cast<const real*>(v),
+ 3,
+ TNG_TRAJ_VELOCITIES,
+ "VELOCITIES",
+ TNG_PARTICLE_BLOCK_DATA,
+ compression)
!= TNG_SUCCESS)
{
gmx_file("Cannot write TNG trajectory frame; maybe you are out of disk space?");
{
/* TNG-MF1 compression only compresses positions and velocities. Use lossless
* compression for forces regardless of output mode */
- if (write_data(tng, step, elapsedSeconds, reinterpret_cast<const real*>(f), 3,
- TNG_TRAJ_FORCES, "FORCES", TNG_PARTICLE_BLOCK_DATA, TNG_GZIP_COMPRESSION)
+ if (write_data(tng,
+ step,
+ elapsedSeconds,
+ reinterpret_cast<const real*>(f),
+ 3,
+ TNG_TRAJ_FORCES,
+ "FORCES",
+ TNG_PARTICLE_BLOCK_DATA,
+ TNG_GZIP_COMPRESSION)
!= TNG_SUCCESS)
{
gmx_file("Cannot write TNG trajectory frame; maybe you are out of disk space?");
{
/* TNG-MF1 compression only compresses positions and velocities. Use lossless
* compression for box shape regardless of output mode */
- if (write_data(tng, step, elapsedSeconds, reinterpret_cast<const real*>(box), 9,
- TNG_TRAJ_BOX_SHAPE, "BOX SHAPE", TNG_NON_PARTICLE_BLOCK_DATA, TNG_GZIP_COMPRESSION)
+ if (write_data(tng,
+ step,
+ elapsedSeconds,
+ reinterpret_cast<const real*>(box),
+ 9,
+ TNG_TRAJ_BOX_SHAPE,
+ "BOX SHAPE",
+ TNG_NON_PARTICLE_BLOCK_DATA,
+ TNG_GZIP_COMPRESSION)
!= TNG_SUCCESS)
{
gmx_file("Cannot write TNG trajectory frame; maybe you are out of disk space?");
{
/* TNG-MF1 compression only compresses positions and velocities. Use lossless
* compression for lambda regardless of output mode */
- if (write_data(tng, step, elapsedSeconds, reinterpret_cast<const real*>(&lambda), 1,
- TNG_GMX_LAMBDA, "LAMBDAS", TNG_NON_PARTICLE_BLOCK_DATA, TNG_GZIP_COMPRESSION)
+ if (write_data(tng,
+ step,
+ elapsedSeconds,
+ reinterpret_cast<const real*>(&lambda),
+ 1,
+ TNG_GMX_LAMBDA,
+ "LAMBDAS",
+ TNG_NON_PARTICLE_BLOCK_DATA,
+ TNG_GZIP_COMPRESSION)
!= TNG_SUCCESS)
{
gmx_file("Cannot write TNG trajectory frame; maybe you are out of disk space?");
tng_num_frames_get(tng, &nFrames);
tng_util_time_of_frame_get(tng, nFrames - 1, &time);
- fTime = time / PICO;
+ fTime = time / gmx::c_pico;
return fTime;
#else
GMX_UNUSED_VALUE(gmx_tng);
#if GMX_USE_TNG
tng_trajectory_t* input = (gmx_tng_input && *gmx_tng_input) ? &(*gmx_tng_input)->tng : nullptr;
/* FIXME after 5.0: Currently only standard block types are read */
- const int defaultNumIds = 5;
- static int64_t fallbackIds[defaultNumIds] = { TNG_TRAJ_BOX_SHAPE, TNG_TRAJ_POSITIONS,
- TNG_TRAJ_VELOCITIES, TNG_TRAJ_FORCES, TNG_GMX_LAMBDA };
- static char fallbackNames[defaultNumIds][32] = { "BOX SHAPE", "POSITIONS", "VELOCITIES",
- "FORCES", "LAMBDAS" };
+ const int defaultNumIds = 5;
+ static int64_t fallbackIds[defaultNumIds] = {
+ TNG_TRAJ_BOX_SHAPE, TNG_TRAJ_POSITIONS, TNG_TRAJ_VELOCITIES, TNG_TRAJ_FORCES, TNG_GMX_LAMBDA
+ };
+ static char fallbackNames[defaultNumIds][32] = {
+ "BOX SHAPE", "POSITIONS", "VELOCITIES", "FORCES", "LAMBDAS"
+ };
typedef tng_function_status (*set_writing_interval_func_pointer)(
- tng_trajectory_t, const int64_t, const int64_t, const int64_t, const char*, const char,
- const char);
+ tng_trajectory_t, const int64_t, const int64_t, const int64_t, const char*, const char, const char);
# if GMX_DOUBLE
set_writing_interval_func_pointer set_writing_interval = tng_util_generic_write_interval_double_set;
# else
tng_molecule_system_copy(*input, *output);
tng_time_per_frame_get(*input, &time);
- tng_time_per_frame_set(*output, time);
- // Since we have copied the value from the input TNG we should not change it again
- (*gmx_tng_output)->timePerFrameIsSet = true;
+ /* Only write the time per frame if it was written (and valid). E.g., single
+ * frame files do not usually contain any time per frame information. */
+ if (time >= 0)
+ {
+ (*gmx_tng_input)->timePerFrameIsSet = true;
+ tng_time_per_frame_set(*output, time);
+ // Since we have copied the value from the input TNG we should not change it again
+ (*gmx_tng_output)->timePerFrameIsSet = true;
+ }
tng_num_frames_per_frame_set_get(*input, &n_frames_per_frame_set);
tng_num_frames_per_frame_set_set(*output, n_frames_per_frame_set);
{
case TNG_TRAJ_POSITIONS:
case TNG_TRAJ_VELOCITIES:
- set_writing_interval(*output, interval, 3, fallbackIds[i], fallbackNames[i],
- TNG_PARTICLE_BLOCK_DATA, compression_type);
+ set_writing_interval(*output,
+ interval,
+ 3,
+ fallbackIds[i],
+ fallbackNames[i],
+ TNG_PARTICLE_BLOCK_DATA,
+ compression_type);
break;
case TNG_TRAJ_FORCES:
- set_writing_interval(*output, interval, 3, fallbackIds[i], fallbackNames[i],
- TNG_PARTICLE_BLOCK_DATA, TNG_GZIP_COMPRESSION);
+ set_writing_interval(*output,
+ interval,
+ 3,
+ fallbackIds[i],
+ fallbackNames[i],
+ TNG_PARTICLE_BLOCK_DATA,
+ TNG_GZIP_COMPRESSION);
break;
case TNG_TRAJ_BOX_SHAPE:
- set_writing_interval(*output, interval, 9, fallbackIds[i], fallbackNames[i],
- TNG_NON_PARTICLE_BLOCK_DATA, TNG_GZIP_COMPRESSION);
+ set_writing_interval(*output,
+ interval,
+ 9,
+ fallbackIds[i],
+ fallbackNames[i],
+ TNG_NON_PARTICLE_BLOCK_DATA,
+ TNG_GZIP_COMPRESSION);
(*gmx_tng_output)->boxOutputInterval = interval;
break;
case TNG_GMX_LAMBDA:
- set_writing_interval(*output, interval, 1, fallbackIds[i], fallbackNames[i],
- TNG_NON_PARTICLE_BLOCK_DATA, TNG_GZIP_COMPRESSION);
+ set_writing_interval(*output,
+ interval,
+ 1,
+ fallbackIds[i],
+ fallbackNames[i],
+ TNG_NON_PARTICLE_BLOCK_DATA,
+ TNG_GZIP_COMPRESSION);
(*gmx_tng_output)->lambdaOutputInterval = interval;
break;
default: continue;
{
natoms = frame->natoms;
}
- gmx_fwrite_tng(gmx_tng_output, TRUE, frame->step, frame->time, 0, frame->box, natoms, frame->x,
- frame->v, frame->f);
+ gmx_fwrite_tng(
+ gmx_tng_output, TRUE, frame->step, frame->time, 0, frame->box, natoms, frame->x, frame->v, frame->f);
#else
GMX_UNUSED_VALUE(gmx_tng_output);
GMX_UNUSED_VALUE(frame);
// GROMACS expects distances in nm
switch (exp)
{
- case 9: distanceScaleFactor = NANO / NANO; break;
- case 10: distanceScaleFactor = NANO / ANGSTROM; break;
+ case 9: distanceScaleFactor = gmx::c_nano / gmx::c_nano; break;
+ case 10: distanceScaleFactor = gmx::c_nano / gmx::c_angstrom; break;
default: distanceScaleFactor = pow(10.0, exp + 9.0);
}
double frameTime = -1.0;
int size, blockDependency;
double prec;
- const int defaultNumIds = 5;
- static int64_t fallbackRequestedIds[defaultNumIds] = { TNG_TRAJ_BOX_SHAPE, TNG_TRAJ_POSITIONS,
- TNG_TRAJ_VELOCITIES, TNG_TRAJ_FORCES,
- TNG_GMX_LAMBDA };
+ const int defaultNumIds = 5;
+ static int64_t fallbackRequestedIds[defaultNumIds] = {
+ TNG_TRAJ_BOX_SHAPE, TNG_TRAJ_POSITIONS, TNG_TRAJ_VELOCITIES, TNG_TRAJ_FORCES, TNG_GMX_LAMBDA
+ };
fr->bStep = FALSE;
tng_data_block_dependency_get(input, blockId, &blockDependency);
if (blockDependency & TNG_PARTICLE_DEPENDENT)
{
- stat = tng_util_particle_data_next_frame_read(input, blockId, &values, &datatype,
- &frameNumber, &frameTime);
+ stat = tng_util_particle_data_next_frame_read(
+ input, blockId, &values, &datatype, &frameNumber, &frameTime);
}
else
{
- stat = tng_util_non_particle_data_next_frame_read(input, blockId, &values, &datatype,
- &frameNumber, &frameTime);
+ stat = tng_util_non_particle_data_next_frame_read(
+ input, blockId, &values, &datatype, &frameNumber, &frameTime);
}
if (stat == TNG_CRITICAL)
{
{
convert_array_to_real_array(reinterpret_cast<char*>(values) + size * i * DIM,
reinterpret_cast<real*>(fr->box[i]),
- getDistanceScaleFactor(gmx_tng_input), 1, DIM, datatype);
+ getDistanceScaleFactor(gmx_tng_input),
+ 1,
+ DIM,
+ datatype);
}
fr->bBox = TRUE;
break;
case TNG_TRAJ_POSITIONS:
srenew(fr->x, fr->natoms);
- convert_array_to_real_array(values, reinterpret_cast<real*>(fr->x),
- getDistanceScaleFactor(gmx_tng_input), fr->natoms, DIM,
+ convert_array_to_real_array(values,
+ reinterpret_cast<real*>(fr->x),
+ getDistanceScaleFactor(gmx_tng_input),
+ fr->natoms,
+ DIM,
datatype);
fr->bX = TRUE;
tng_util_frame_current_compression_get(input, blockId, &codecId, &prec);
break;
case TNG_TRAJ_VELOCITIES:
srenew(fr->v, fr->natoms);
- convert_array_to_real_array(values, reinterpret_cast<real*>(fr->v),
- getDistanceScaleFactor(gmx_tng_input), fr->natoms, DIM,
+ convert_array_to_real_array(values,
+ reinterpret_cast<real*>(fr->v),
+ getDistanceScaleFactor(gmx_tng_input),
+ fr->natoms,
+ DIM,
datatype);
fr->bV = TRUE;
tng_util_frame_current_compression_get(input, blockId, &codecId, &prec);
break;
case TNG_TRAJ_FORCES:
srenew(fr->f, fr->natoms);
- convert_array_to_real_array(values, reinterpret_cast<real*>(fr->f),
- getDistanceScaleFactor(gmx_tng_input), fr->natoms, DIM,
+ convert_array_to_real_array(values,
+ reinterpret_cast<real*>(fr->f),
+ getDistanceScaleFactor(gmx_tng_input),
+ fr->natoms,
+ DIM,
datatype);
fr->bF = TRUE;
break;
fr->bStep = TRUE;
// Convert the time to ps
- fr->time = frameTime / PICO;
+ fr->time = frameTime / gmx::c_pico;
fr->bTime = (frameTime > 0);
// TODO This does not leak, but is not exception safe.
}
tng_num_particles_get(input, &nAtoms);
- stat = tng_particle_data_vector_get(input, TNG_TRAJ_PARTIAL_CHARGES, &data, &nFramesRead,
- &strideLength, &nParticlesRead, &nValuesPerFrameRead, &datatype);
+ stat = tng_particle_data_vector_get(input,
+ TNG_TRAJ_PARTIAL_CHARGES,
+ &data,
+ &nFramesRead,
+ &strideLength,
+ &nParticlesRead,
+ &nValuesPerFrameRead,
+ &datatype);
if (stat == TNG_SUCCESS)
{
atomCharges.resize(nAtoms);
}
}
- stat = tng_particle_data_vector_get(input, TNG_TRAJ_MASSES, &data, &nFramesRead, &strideLength,
- &nParticlesRead, &nValuesPerFrameRead, &datatype);
+ stat = tng_particle_data_vector_get(
+ input, TNG_TRAJ_MASSES, &data, &nFramesRead, &strideLength, &nParticlesRead, &nValuesPerFrameRead, &datatype);
if (stat == TNG_SUCCESS)
{
atomMasses.resize(nAtoms);
if (blockDependency & TNG_PARTICLE_DEPENDENT)
{
tng_num_particles_get(input, nAtoms);
- stat = tng_util_particle_data_next_frame_read(input, blockId, &data, &datatype, frameNumber,
- frameTime);
+ stat = tng_util_particle_data_next_frame_read(
+ input, blockId, &data, &datatype, frameNumber, frameTime);
}
else
{
*nAtoms = 1; /* There are not actually any atoms, but it is used for
allocating memory */
- stat = tng_util_non_particle_data_next_frame_read(input, blockId, &data, &datatype,
- frameNumber, frameTime);
+ stat = tng_util_non_particle_data_next_frame_read(
+ input, blockId, &data, &datatype, frameNumber, frameTime);
}
if (stat == TNG_CRITICAL)
{
gmx_file("Cannot read next frame of TNG file");
}
srenew(*values, sizeof(real) * *nValuesPerFrame * *nAtoms);
- convert_array_to_real_array(data, *values, getDistanceScaleFactor(gmx_tng_input), *nAtoms,
- *nValuesPerFrame, datatype);
+ convert_array_to_real_array(
+ data, *values, getDistanceScaleFactor(gmx_tng_input), *nAtoms, *nValuesPerFrame, datatype);
tng_util_frame_current_compression_get(input, blockId, &codecId, &localPrec);