150{
151 int iarg = 0;
152
153
154 if (narg < 1) error->all(FLERR,"Illegal pair_style command");
155
156
157 int len = strlen(arg[iarg]) + 1;
160 iarg++;
162 vector<FILE*> fp;
163 if (screen) fp.push_back(screen);
164 if (logfile) fp.push_back(logfile);
166
167
168 len = strlen("hdnnp/") + 1;
171 len = strlen("nnp-predict 0") + 1;
173 strcpy(
command,
"nnp-predict 0");
176
177 while(iarg < narg) {
178
179 if (strcmp(arg[iarg],"dir") == 0) {
180 if (iarg+2 > narg)
181 error->all(FLERR,"Illegal pair_style command");
183 len = strlen(arg[iarg+1]) + 2;
186 iarg += 2;
187
188 } else if (strcmp(arg[iarg],"command") == 0) {
189 if (iarg+2 > narg)
190 error->all(FLERR,"Illegal pair_style command");
192 len = strlen(arg[iarg+1]) + 1;
194 sprintf(
command,
"%s", arg[iarg+1]);
195 iarg += 2;
196
197 } else if (strcmp(arg[iarg],"cflength") == 0) {
198 if (iarg+2 > narg)
199 error->all(FLERR,"Illegal pair_style command");
200 cflength = utils::numeric(FLERR,arg[iarg+1],
false,lmp);
201 iarg += 2;
202
203 } else if (strcmp(arg[iarg],"cfenergy") == 0) {
204 if (iarg+2 > narg)
205 error->all(FLERR,"Illegal pair_style command");
206 cfenergy = utils::numeric(FLERR,arg[iarg+1],
false,lmp);
207 iarg += 2;
208 } else error->all(FLERR,"Illegal pair_style command");
209 }
210
211 for (auto f : fp)
212 {
213 fprintf(f, "*****************************************"
214 "**************************************\n");
215 fprintf(f, "pair_style hdnnp/external settings:\n");
216 fprintf(f, "-----------------------------------\n");
217 fprintf(f,
"elements = %s\n",
elements);
219 fprintf(f,
"command = %s\n",
command);
220 fprintf(f,
"cflength = %16.8E\n",
cflength);
221 fprintf(f,
"cfenergy = %16.8E\n",
cfenergy);
222 fprintf(f, "*****************************************"
223 "**************************************\n");
224 fprintf(f, "CAUTION: Explicit element mapping is not available for hdnnp/external,\n");
225 fprintf(f, " please carefully check whether this map between LAMMPS\n");
226 fprintf(f, " atom types and element strings is correct:\n");
227 fprintf(f, "---------------------------\n");
228 fprintf(f, "LAMMPS type | NNP element\n");
229 fprintf(f, "---------------------------\n");
230 int lammpsNtypes =
em.
size();
231 for (int i = 0; i < lammpsNtypes; ++i)
232 {
233 fprintf(f, "%11d <-> %2s (%3zu)\n",
235 }
236 fprintf(f, "*****************************************"
237 "**************************************\n");
238 }
239}
std::size_t registerElements(std::string const &elementLine)
Extract all elements and store in element map.
std::size_t size() const
Get element map size.
std::size_t atomicNumber(std::size_t index) const
Get atomic number from element index.
void setElementMap(ElementMap const &elementMap)
Set element map of structure.