Skip to content

Commit

Permalink
add bond_type option to fix template/multiplespheres
Browse files Browse the repository at this point in the history
  • Loading branch information
danielque committed Aug 9, 2018
1 parent be85da6 commit 52f4581
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/fix_template_multiplespheres.cpp
Expand Up @@ -77,6 +77,7 @@ FixTemplateMultiplespheres::FixTemplateMultiplespheres(LAMMPS *lmp, int narg, ch
atom_type_sphere = 0;

bonded = false;
bond_type = 1;
// number of partners and partner array
np = NULL;
p = NULL;
Expand Down Expand Up @@ -235,8 +236,20 @@ FixTemplateMultiplespheres::FixTemplateMultiplespheres(LAMMPS *lmp, int narg, ch
}
hasargs = true;
}
else if(strcmp(arg[iarg],"bond_type") == 0)
{
if (narg < iarg+2)
error->fix_error(FLERR,this,"not enough arguments for option 'bond_type'");
bond_type = atoi(arg[iarg+1]);
if (bond_type < 1 || bond_type > atom->nbondtypes)
error->fix_error(FLERR,this,"'bond_type' value must be > 0 and <= number of bond types");
iarg += 2;
hasargs = true;
}
else if(strcmp(style,"particletemplate/multiplespheres") == 0)
{
error->fix_error(FLERR,this,"unknown keyword");
}
}

if(!spheres_read) error->fix_error(FLERR,this,"need to define spheres for the template");
Expand Down Expand Up @@ -580,7 +593,7 @@ void FixTemplateMultiplespheres::randomize_ptilist(int n_random,int distribution
pti->fix_property_value[0][0] = static_cast<double>(update->ntimestep)+random->uniform();
pti->n_fix_property = 1;
pti->fix_property_nentry[0] = 1;
pti->bond_type = 1; // TODO get from input script
pti->bond_type = bond_type;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/fix_template_multiplespheres.h
Expand Up @@ -104,6 +104,7 @@ class FixTemplateMultiplespheres : public FixTemplateSphere {
int ntry;

bool bonded;
int bond_type;

class FixPropertyAtom *fix_bond_random_id;
};
Expand Down

0 comments on commit 52f4581

Please sign in to comment.