2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2019, by the GROMACS development team, led by
5 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 * and including many others, as listed in the AUTHORS file in the
7 * top-level source directory and at http://www.gromacs.org.
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
37 * Enum class defining the different requirements that outputadapters
38 * have for the output file type. OutputManager objects can only be built
39 * with OutputAdapters whose requirements can be implemented with the available input.
41 * \author Paul Bauer <paul.bauer.q@gmail.com>
43 * \ingroup module_coordinateio
45 #ifndef GMX_COORDINATEIO_ENUMS_H
46 #define GMX_COORDINATEIO_ENUMS_H
52 * The enums here define the flags specifying the requirements
53 * of different outputadapter modules.
55 * When building the object for deciding on the output to a new coordinate file,
56 * the CoordinateFile object needs to be able to validate that the dependencies of
57 * attached IOutputAdapters are fulfilled. Classes and interfaces that use
58 * the enum can check their dependencies against the information encoded in the
59 * flags and can then perform an appropriate reaction if there is a mismatch.
60 * \todo Use std::bitset<16> for the entries.
63 * \ingroup module_coordinateio
66 enum class CoordinateFileFlags
: unsigned long
69 * Base setting that says that the module has no requirements.
71 * Sets the flags to default setting to make sure all output methods
76 * Requires output method to support force output.
78 * If set, only output methods supporting writing of forces will work,
79 * others will generate an invalid input error.
81 RequireForceOutput
= 1<<1,
83 * Requires output method to support velocity output.
85 * If set, only writing to files that support velocity output will succeed.
86 * Other writing methods will generate an error.
88 RequireVelocityOutput
= 1<<2,
90 * Requires support for connection information in output format.
92 * If set, only file output that supports writing of connection information will succeed.
93 * This means for now that only PDB and TNG files can be written. Other file writing
96 RequireAtomConnections
= 1<<3,
98 * Requires that output format supports the writing of atom information to the file.
100 * If set, files will only be written if they can output the information from t_atoms
101 * and otherwise create an error while writing.
103 RequireAtomInformation
= 1<<4,
105 * Requires that output format supports writing user-specified output precision.
107 * If set, output will only be written if the format supports the writing
108 * of custom precision of the included data.
110 RequireChangedOutputPrecision
= 1<<5,
112 * Requires that output format supports writing time to the file.
114 RequireNewFrameStartTime
= 1<<6,
116 * Requires that output format supports writing time to the file.
118 RequireNewFrameTimeStep
= 1<<7,
120 * Requires that output format supports writing box information.
122 RequireNewBox
= 1<<8,
124 * Requires output to support changes to selection of coordinates.
126 * Default for most methods, will need to be able to write coordinates to
127 * output file or generate an error.
129 RequireCoordinateSelection
= 1<<9,
130 //! Needed for enumeration array.
134 //! Conversion of flag to its corresponding unsigned long value.
135 inline unsigned long convertFlag(CoordinateFileFlags flag
)
137 return static_cast<unsigned long>(flag
);
140 //! Enum class for setting basic flags in a t_trxframe
141 enum class ChangeSettingType
147 //! Mapping for enums from \ref ChangeSettingType.
148 const char *const cChangeSettingTypeEnum
[] = {
149 "preserved-if-present", "always", "never"
152 //! Enum class for t_atoms settings
153 enum class ChangeAtomsType
161 //! Mapping for enums from \ref ChangeAtomsType.
162 const char *const cChangeAtomsTypeEnum
[] = {
163 "preserved-if-present", "always-from-structure", "never", "always"
166 //! Enum class for setting fields new or not.
167 enum class ChangeFrameInfoType
172 //! Mapping for enums from \ref ChangeFrameInfoType.
173 const char *const cChangeFrameInfoTypeEnum
[] = {
174 "preserved-if-present", "always"
177 //! Enum class for setting frame time from user input.
178 enum class ChangeFrameTimeType
186 //! Mapping for values from \ref ChangeFrameTimeType.
187 const char *const cChangeFrameTimeTypeEnum
[] = {
188 "preserved-if-present", "starttime", "timestep", "both"