2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2016,2017, 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 * This file contains data types containing ioin/water position exchange
38 * data to be stored in the checkpoint file.
41 #ifndef GMX_MDLIB_SWAPHISTORY_H
42 #define GMX_MDLIB_SWAPHISTORY_H
44 /* History of an ion type used in position swapping
46 typedef struct swapstateIons_t
48 int nMolReq[eCompNR]; // Requested # of molecules per compartment
49 int *nMolReq_p[eCompNR]; // Pointer to this data (for checkpoint writing)
50 int inflow_net[eCompNR]; // Flux determined from the # of swaps
51 int *inflow_net_p[eCompNR]; // Pointer to this data
52 int *nMolPast[eCompNR]; // Array with nAverage entries for history
53 int *nMolPast_p[eCompNR]; // Pointer points to the first entry only
55 // Channel flux detection, this is counting only and has no influence on whether swaps are performed or not: */
56 int fluxfromAtoB[eCompNR]; // Flux determined from the split cylinders
57 int *fluxfromAtoB_p[eCompNR]; // Pointer to this data
58 int nMol; // Number of molecules, size of the following arrays
59 unsigned char *comp_from; // Ion came from which compartment?
60 unsigned char *channel_label; // Through which channel did this ion pass?
63 /* Position swapping state
65 * To also make multimeric channel proteins whole, we save the last whole configuration
66 * of the channels in the checkpoint file. If we have no checkpoint file, we assume
67 * that the starting configuration has the correct PBC representation after making the
68 * individual molecules whole
70 * \todo move out of this file to ObservablesHistory
73 typedef struct swaphistory_t
75 int eSwapCoords; // Swapping along x, y, or z-direction?
76 int nIonTypes; // Number of ion types, this is the size of the following arrays
77 int nAverage; // Use average over this many swap attempt steps when determining the ion counts
78 int fluxleak; // Ions not going through any channel (bad!)
79 int *fluxleak_p; // Pointer to this data
80 gmx_bool bFromCpt; // Did we start from a checkpoint file?
81 int nat[eChanNR]; // Size of xc_old_whole, i.e. the number of atoms in each channel
82 rvec *xc_old_whole[eChanNR]; // Last known whole positions of the two channels (important for multimeric ch.!)
83 rvec **xc_old_whole_p[eChanNR]; // Pointer to these positions
84 swapstateIons_t *ionType; // History information for one ion type