From 3a079c666c963eaeeb46f1fd2d66fb8f996eced9 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 20 Jun 2021 22:06:58 -0400 Subject: [PATCH] fix bug when reading masses --- src/USER-RANN/pair_rann.cpp | 10 ++++------ src/USER-RANN/pair_rann.h | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/USER-RANN/pair_rann.cpp b/src/USER-RANN/pair_rann.cpp index 4cf3b063d9..59ad688cb5 100644 --- a/src/USER-RANN/pair_rann.cpp +++ b/src/USER-RANN/pair_rann.cpp @@ -94,9 +94,7 @@ PairRANN::PairRANN(LAMMPS *lmp) : Pair(lmp) //at least one of the following will change during fingerprint definition: doscreen = false; allscreen = true; - dospin = false; - } PairRANN::~PairRANN() @@ -327,7 +325,7 @@ void PairRANN::read_file(char *filename) linev = values.as_vector(); line1v = values1.as_vector(); if (linev[0]=="atomtypes") read_atom_types(line1v,filename,linenum); - else if (linev[0]=="mass") read_mass(line1v,filename,linenum); + else if (linev[0]=="mass") read_mass(linev,line1v,filename,linenum); else if (linev[0]=="fingerprintsperelement") read_fpe(linev,line1v,filename,linenum); else if (linev[0]=="fingerprints") read_fingerprints(linev,line1v,filename,linenum); else if (linev[0]=="fingerprintconstants") read_fingerprint_constants(linev,line1v,filename,linenum); @@ -368,11 +366,11 @@ void PairRANN::read_atom_types(std::vector line,char *filename,int allocate(line); } -void PairRANN::read_mass(const std::vector &line,char *filename,int linenum) { +void PairRANN::read_mass(const std::vector &line1, const std::vector &line2, const char *filename,int linenum) { if (nelements == -1)error->one(filename,linenum-1,"atom types must be defined before mass in potential file."); for (int i=0;i &);//called after reading element list, but before reading the rest of the potential void read_file(char *);//read potential file void read_atom_types(std::vector,char*,int); - void read_mass(const std::vector &,char*,int); void read_fpe(std::vector,std::vector,char*,int);//fingerprints per element. Count total fingerprints defined for each 1st element in element combinations void read_fingerprints(std::vector,std::vector,char*,int); void read_fingerprint_constants(std::vector,std::vector,char*,int); @@ -148,6 +147,7 @@ namespace LAMMPS_NS { void read_bias(std::vector,std::vector,FILE*,char*,int*);//biases should be formatted as properly shaped vectors void read_activation_functions(std::vector,std::vector,char*,int); void read_screening(std::vector,std::vector,char*,int); + void read_mass(const std::vector &, const std::vector &,const char*,int); bool check_potential();//after finishing reading potential file void propagateforward(double *,double **,double **,int,int);//called by compute to get force and energy void propagateforwardspin(double *,double **,double **,double**,int,int);//called by compute to get force and energy