1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(cmap,FixCMAP)
#else
#ifndef LMP_FIX_CMAP_H
#define LMP_FIX_CMAP_H
#include "fix.h"
namespace LAMMPS_NS {
class FixCMAP : public Fix {
public:
FixCMAP(class LAMMPS *, int, char **);
~FixCMAP();
int setmask();
void init();
void setup(int);
void setup_pre_neighbor();
void setup_pre_reverse(int, int);
void min_setup(int);
void pre_neighbor();
void pre_reverse(int, int);
void post_force(int);
void post_force_respa(int, int, int);
void min_post_force(int);
double compute_scalar();
void read_data_header(char *);
void read_data_section(char *, int, char *, tagint);
bigint read_data_skip_lines(char *);
void write_data_header(FILE *, int);
void write_data_section_size(int, int &, int &);
void write_data_section_pack(int, double **);
void write_data_section_keyword(int, FILE *);
void write_data_section(int, FILE *, int, double **, int);
void write_restart(FILE *);
void restart(char *);
int pack_restart(int, double *);
void unpack_restart(int, int);
int size_restart(int);
int maxsize_restart();
void grow_arrays(int);
void copy_arrays(int, int, int);
void set_arrays(int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
double memory_usage();
private:
int nprocs,me;
int newton_bond,eflag_caller;
int ctype,nlevels_respa;
int ncrosstermtypes,crossterm_per_atom,maxcrossterm;
int ncrosstermlist;
bigint ncmap;
int **crosstermlist;
int nmax_previous;
int *num_crossterm;
int **crossterm_type;
tagint **crossterm_atom1,**crossterm_atom2,**crossterm_atom3;
tagint **crossterm_atom4,**crossterm_atom5;
double E,dEdPhi,dEdPsi;
double ecmap;
double fcmap[4],cij[4][4];
double *g_axis;
// CMAP grid points obtained from external file
double ***cmapgrid;
// partial derivatives and cross-derivatives of the grid data
double ***d1cmapgrid,***d2cmapgrid,***d12cmapgrid;
// read map grid data
void read_grid_map(char *);
// read in CMAP cross terms from LAMMPS data file
void read_cmap_data(int, char *);
// pre-compute the partial and cross-derivatives of map grid points
void set_map_derivatives(double **, double **, double **, double **);
// cubic spline interpolation functions for derivatives of map grid points
void spline(double *, double *, int);
void spl_interpolate(double, double *, double *, double &, double &);
// calculate dihedral angles
double dihedral_angle_atan2(double, double, double, double, double, double,
double, double, double, double);
// calculate bicubic interpolation coefficient matrix c_ij
void bc_coeff(double *, double *, double *, double *);
// perform bicubic interpolation at point of interest
void bc_interpol(double, double, int, int, double *, double *, double *,
double *);
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
UNDOCUMENTED
E: CMAP atoms %d %d %d %d %d missing on proc %d at step %ld
UNDOCUMENTED
E: Invalid CMAP crossterm_type
UNDOCUMENTED
E: Cannot open fix cmap file %s
UNDOCUMENTED
E: CMAP: atan2 function cannot take 2 zero arguments
UNDOCUMENTED
E: Invalid read data header line for fix cmap
UNDOCUMENTED
E: Incorrect %s format in data file
UNDOCUMENTED
E: Too many CMAP crossterms for one atom
UNDOCUMENTED
*/