add pointer Force class to temporarily hold the name of the restarted pair style

This commit is contained in:
Axel Kohlmeyer 2018-03-19 18:03:13 -04:00
parent c2c49395bd
commit 3c94f7d5d1
2 changed files with 7 additions and 0 deletions

View File

@ -78,6 +78,8 @@ Force::Force(LAMMPS *lmp) : Pointers(lmp)
kspace_style = new char[n];
strcpy(kspace_style,str);
pair_restart = NULL;
// fill pair map with pair styles listed in style_pair.h
pair_map = new PairCreatorMap();
@ -146,6 +148,8 @@ Force::~Force()
delete [] improper_style;
delete [] kspace_style;
delete [] pair_restart;
if (pair) delete pair;
if (bond) delete bond;
if (angle) delete angle;
@ -197,8 +201,10 @@ void Force::create_pair(const char *style, int trysuffix)
{
delete [] pair_style;
if (pair) delete pair;
if (pair_restart) delete [] pair_restart;
pair_style = NULL;
pair = NULL;
pair_restart = NULL;
int sflag;
pair = new_pair(style,trysuffix,sflag);

View File

@ -50,6 +50,7 @@ class Force : protected Pointers {
class Pair *pair;
char *pair_style;
char *pair_restart;
class Bond *bond;
char *bond_style;