Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / legacyheaders / oenv.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5  * Copyright (c) 2001-2004, The GROMACS development team.
6  * Copyright (c) 2012,2014, by the GROMACS development team, led by
7  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
8  * and including many others, as listed in the AUTHORS file in the
9  * top-level source directory and at http://www.gromacs.org.
10  *
11  * GROMACS is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public License
13  * as published by the Free Software Foundation; either version 2.1
14  * of the License, or (at your option) any later version.
15  *
16  * GROMACS is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with GROMACS; if not, see
23  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
24  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
25  *
26  * If you want to redistribute modifications to GROMACS, please
27  * consider that scientific software is very special. Version
28  * control is crucial - bugs must be traceable. We will be happy to
29  * consider code for inclusion in the official distribution, but
30  * derived work must not be called official GROMACS. Details are found
31  * in the README & COPYING files - if they are missing, get the
32  * official version at http://www.gromacs.org.
33  *
34  * To help us fund GROMACS development, we humbly ask that you cite
35  * the research papers on the package. Check out http://www.gromacs.org.
36  */
37
38 #ifndef _oenv_h
39 #define _oenv_h
40
41 #include "gromacs/legacyheaders/types/oenv.h"
42 #include "gromacs/legacyheaders/types/simple.h"
43
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 #if 0 /* avoid screwing up indentation */
48 }
49 #endif
50
51
52 /* output_env member functions */
53
54 /* The output_env structure holds information about program name, cmd line,
55    default times, etc.
56
57    There are still legacy functions for the program name, and the command
58    line, but the output_env versions are now preferred.*/
59
60 typedef enum
61 {
62     timeNULL, time_fs, time_ps, time_ns, time_us, time_ms, time_s
63 } time_unit_t;
64 /* the time units. For the time being, ps means no conversion. */
65
66 typedef enum {
67     exvgNULL, exvgXMGRACE, exvgXMGR, exvgNONE
68 } xvg_format_t;
69 /* the xvg output formattings */
70
71
72 void output_env_init_default(output_env_t *oenvp);
73 /* initialize an output_env structure, with reasonable default settings.
74     (the time unit is set to time_ps, which means no conversion).  */
75
76 void output_env_done(output_env_t oenv);
77 /* free memory allocated for an output_env structure. */
78
79
80 int output_env_get_verbosity(const output_env_t oenv);
81 /* return the verbosity */
82
83 const char *output_env_get_time_unit(const output_env_t oenv);
84 /* return time unit (e.g. ps or ns) */
85
86 const char *output_env_get_time_label(const output_env_t oenv);
87 /* return time unit label (e.g. "Time (ps)") */
88
89 const char *output_env_get_xvgr_tlabel(const output_env_t oenv);
90 /* retrun x-axis time label for xmgr */
91
92 real output_env_get_time_factor(const output_env_t oenv);
93 /* return time conversion factor from ps (i.e. 1e-3 for ps->ns) */
94
95 real output_env_get_time_invfactor(const output_env_t oenv);
96 /* return inverse time conversion factor to ps (i.e. 1e3 for ns->ps) */
97
98 real output_env_conv_time(const output_env_t oenv, real time);
99 /* return converted time */
100
101 void output_env_conv_times(const output_env_t oenv, int n, real *time);
102 /* convert array of times */
103
104 gmx_bool output_env_get_view(const output_env_t oenv);
105 /* Return TRUE when user requested viewing of the file */
106
107 xvg_format_t output_env_get_xvg_format(const output_env_t oenv);
108 /* Returns enum (see above) for xvg output formatting */
109
110 /*! \brief
111  * Returns display name for the currently running program.
112  */
113 const char *output_env_get_program_display_name(const output_env_t oenv);
114
115 #ifdef __cplusplus
116 }
117
118 namespace gmx
119 {
120 class ProgramContextInterface;
121 } // namespace gmx
122
123 void output_env_init(output_env_t *oenvp,
124                      const gmx::ProgramContextInterface &context,
125                      time_unit_t tmu, gmx_bool view, xvg_format_t xvg_format,
126                      int verbosity);
127 /* initialize an output_env structure, setting the command line,
128    the default time value a gmx_boolean view that is set to TRUE when the
129    user requests direct viewing of graphs,
130    the graph formatting type, the verbosity, and debug level */
131
132 /*! \brief
133  * Returns gmx::ProgramContextInterface from an output_env structure.
134  */
135 const gmx::ProgramContextInterface &
136 output_env_get_program_context(const output_env_t oenv);
137
138 #endif
139
140 #endif