/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2019, by the GROMACS development team, led by
+ * Copyright (c) 2019,2020, 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 "gromacs/math/vectypes.h"
#include "modularsimulatorinterfaces.h"
+#include "topologyholder.h"
struct gmx_mdoutf;
struct t_commrec;
public ISimulatorElement,
public ITrajectoryWriterClient,
public ITrajectorySignallerClient,
- public ICheckpointHelperClient
+ public ICheckpointHelperClient,
+ public ILastStepSignallerClient
{
public:
//! Constructor
int nstxout_compressed,
bool useGPU,
FreeEnergyPerturbationElement* freeEnergyPerturbationElement,
+ const TopologyHolder* topologyHolder,
+ bool canMoleculesBeDistributedOverPBC,
+ bool writeFinalConfiguration,
+ std::string finalConfigurationFilename,
const t_inputrec* inputrec,
const t_mdatoms* mdatoms);
//! ICheckpointHelperClient implementation
void writeCheckpoint(t_state* localState, t_state* globalState) override;
+ //! ILastStepSignallerClient implementation (used for final output only)
+ SignallerCallbackPtr registerLastStepCallback() override;
+
//! Callback writing the state to file
void write(gmx_mdoutf* outf, Step step, Time time);
//! Pointer to the free energy perturbation element (for trajectory writing only)
FreeEnergyPerturbationElement* freeEnergyPerturbationElement_;
+ //! Whether planned total number of steps was reached (used for final output only)
+ bool isRegularSimulationEnd_;
+ //! The signalled last step (used for final output only)
+ Step lastStep_;
+
+ //! Whether system can have molecules distributed over PBC boundaries (used for final output only)
+ const bool canMoleculesBeDistributedOverPBC_;
+ //! Whether system has molecules self-interacting through PBC (used for final output only)
+ const bool systemHasPeriodicMolecules_;
+ //! The PBC type (used for final output only)
+ const int pbcType_;
+ //! Pointer to the topology (used for final output only)
+ const TopologyHolder* topologyHolder_;
+ //! The (planned) last step - determines whether final configuration is written (used for final output only)
+ const Step lastPlannedStep_;
+ //! Whether final configuration was chosen in mdrun options (used for final output only)
+ const bool writeFinalConfiguration_;
+ //! The filename of the final configuration file (used for final output only)
+ const std::string finalConfigurationFilename_;
+
// Access to ISimulator data
//! Handles logging.
FILE* fplog_;
//! No trajectory writer setup needed
void trajectoryWriterSetup(gmx_mdoutf gmx_unused* outf) override {}
- //! No trajectory writer teardown needed
- void trajectoryWriterTeardown(gmx_mdoutf gmx_unused* outf) override {}
+ //! Trajectory writer teardown - write final coordinates
+ void trajectoryWriterTeardown(gmx_mdoutf* outf) override;
};
} // namespace gmx