forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@7379 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
70316a8f77
commit
4f48544d41
|
@ -460,7 +460,7 @@ double PairLJClass2CoulLong::single(int i, int j, int itype, int jtype,
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void *PairLJClass2CoulLong::extract(char *str, int &dim)
|
||||
void *PairLJClass2CoulLong::extract(const char *str, int &dim)
|
||||
{
|
||||
dim = 0;
|
||||
if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul;
|
||||
|
|
|
@ -38,7 +38,7 @@ class PairLJClass2CoulLong : public Pair {
|
|||
void write_restart_settings(FILE *);
|
||||
void read_restart_settings(FILE *);
|
||||
double single(int, int, int, int, double, double, double, double &);
|
||||
void *extract(char *, int &);
|
||||
void *extract(const char *, int &);
|
||||
|
||||
protected:
|
||||
double cut_lj_global;
|
||||
|
|
|
@ -489,7 +489,7 @@ double PairBornCoulLong::single(int i, int j, int itype, int jtype,
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void *PairBornCoulLong::extract(char *str, int &dim)
|
||||
void *PairBornCoulLong::extract(const char *str, int &dim)
|
||||
{
|
||||
dim = 0;
|
||||
if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul;
|
||||
|
|
|
@ -38,7 +38,7 @@ class PairBornCoulLong : public Pair {
|
|||
void write_restart_settings(FILE *);
|
||||
void read_restart_settings(FILE *);
|
||||
double single(int, int, int, int, double, double, double, double &);
|
||||
void *extract(char *, int &);
|
||||
void *extract(const char *, int &);
|
||||
|
||||
protected:
|
||||
double cut_lj_global;
|
||||
|
|
|
@ -459,7 +459,7 @@ double PairBuckCoulLong::single(int i, int j, int itype, int jtype,
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void *PairBuckCoulLong::extract(char *str, int &dim)
|
||||
void *PairBuckCoulLong::extract(const char *str, int &dim)
|
||||
{
|
||||
dim = 0;
|
||||
if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul;
|
||||
|
|
|
@ -38,7 +38,7 @@ class PairBuckCoulLong : public Pair {
|
|||
void write_restart_settings(FILE *);
|
||||
void read_restart_settings(FILE *);
|
||||
double single(int, int, int, int, double, double, double, double &);
|
||||
void *extract(char *, int &);
|
||||
void *extract(const char *, int &);
|
||||
|
||||
protected:
|
||||
double cut_lj_global;
|
||||
|
|
|
@ -556,7 +556,7 @@ double PairCoulLong::single(int i, int j, int itype, int jtype,
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void *PairCoulLong::extract(char *str, int &dim)
|
||||
void *PairCoulLong::extract(const char *str, int &dim)
|
||||
{
|
||||
if (strcmp(str,"cut_coul") == 0) {
|
||||
dim = 0;
|
||||
|
|
|
@ -38,7 +38,7 @@ class PairCoulLong : public Pair {
|
|||
virtual void write_restart_settings(FILE *);
|
||||
virtual void read_restart_settings(FILE *);
|
||||
virtual double single(int, int, int, int, double, double, double, double &);
|
||||
void *extract(char *, int &);
|
||||
void *extract(const char *, int &);
|
||||
|
||||
protected:
|
||||
double cut_coul,cut_coulsq;
|
||||
|
|
|
@ -1181,7 +1181,7 @@ double PairLJCharmmCoulLong::single(int i, int j, int itype, int jtype,
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void *PairLJCharmmCoulLong::extract(char *str, int &dim)
|
||||
void *PairLJCharmmCoulLong::extract(const char *str, int &dim)
|
||||
{
|
||||
dim = 2;
|
||||
if (strcmp(str,"lj14_1") == 0) return (void *) lj14_1;
|
||||
|
|
|
@ -44,7 +44,7 @@ class PairLJCharmmCoulLong : public Pair {
|
|||
void compute_inner();
|
||||
void compute_middle();
|
||||
void compute_outer(int, int);
|
||||
void *extract(char *, int &);
|
||||
void *extract(const char *, int &);
|
||||
|
||||
protected:
|
||||
int implicit;
|
||||
|
|
|
@ -1122,7 +1122,7 @@ double PairLJCutCoulLong::single(int i, int j, int itype, int jtype,
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void *PairLJCutCoulLong::extract(char *str, int &dim)
|
||||
void *PairLJCutCoulLong::extract(const char *str, int &dim)
|
||||
{
|
||||
dim = 0;
|
||||
if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul;
|
||||
|
|
|
@ -43,7 +43,7 @@ class PairLJCutCoulLong : public Pair {
|
|||
void compute_inner();
|
||||
void compute_middle();
|
||||
void compute_outer(int, int);
|
||||
void *extract(char *, int &);
|
||||
void *extract(const char *, int &);
|
||||
|
||||
protected:
|
||||
double cut_lj_global;
|
||||
|
|
|
@ -503,7 +503,7 @@ void PairLJCutCoulLongTIP4P::find_M(int i, int &iH1, int &iH2, double *xM)
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void *PairLJCutCoulLongTIP4P::extract(char *str, int &dim)
|
||||
void *PairLJCutCoulLongTIP4P::extract(const char *str, int &dim)
|
||||
{
|
||||
dim = 0;
|
||||
if (strcmp(str,"qdist") == 0) return (void *) &qdist;
|
||||
|
|
|
@ -32,7 +32,7 @@ class PairLJCutCoulLongTIP4P : public PairLJCutCoulLong {
|
|||
void init_style();
|
||||
void write_restart_settings(FILE *fp);
|
||||
void read_restart_settings(FILE *fp);
|
||||
void *extract(char *, int &);
|
||||
void *extract(const char *, int &);
|
||||
|
||||
protected:
|
||||
int typeH,typeO; // atom types of TIP4P water H and O atoms
|
||||
|
|
|
@ -67,8 +67,8 @@ FixBondSwap::FixBondSwap(LAMMPS *lmp, int narg, char **arg) :
|
|||
|
||||
char **newarg = new char*[3];
|
||||
newarg[0] = id_temp;
|
||||
newarg[1] = "all";
|
||||
newarg[2] = "temp";
|
||||
newarg[1] = (char *) "all";
|
||||
newarg[2] = (char *) "temp";
|
||||
modify->add_compute(3,newarg);
|
||||
delete [] newarg;
|
||||
tflag = 1;
|
||||
|
|
|
@ -36,10 +36,11 @@ using namespace LAMMPS_NS;
|
|||
|
||||
enum{FCC,BCC,HCP,DIM,DIAMOND,B1,C11,L12,B2};
|
||||
int nkeywords = 21;
|
||||
char *keywords[] = {"Ec","alpha","rho0","delta","lattce",
|
||||
"attrac","repuls","nn2","Cmin","Cmax","rc","delr",
|
||||
"augt1","gsmooth_factor","re","ialloy","mixture_ref_t",
|
||||
"erose_form","zbl","emb_lin_neg","bkgd_dyn"};
|
||||
const char *keywords[] = {"Ec","alpha","rho0","delta","lattce",
|
||||
"attrac","repuls","nn2","Cmin","Cmax","rc","delr",
|
||||
"augt1","gsmooth_factor","re","ialloy",
|
||||
"mixture_ref_t","erose_form","zbl",
|
||||
"emb_lin_neg","bkgd_dyn"};
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
|
|
|
@ -493,7 +493,7 @@ double PairLJCharmmCoulCharmm::single(int i, int j, int itype, int jtype,
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void *PairLJCharmmCoulCharmm::extract(char *str, int &dim)
|
||||
void *PairLJCharmmCoulCharmm::extract(const char *str, int &dim)
|
||||
{
|
||||
dim = 2;
|
||||
if (strcmp(str,"lj14_1") == 0) return (void *) lj14_1;
|
||||
|
|
|
@ -38,7 +38,7 @@ class PairLJCharmmCoulCharmm : public Pair {
|
|||
void write_restart_settings(FILE *);
|
||||
void read_restart_settings(FILE *);
|
||||
virtual double single(int, int, int, int, double, double, double, double &);
|
||||
virtual void *extract(char *, int &);
|
||||
virtual void *extract(const char *, int &);
|
||||
|
||||
protected:
|
||||
int implicit;
|
||||
|
|
|
@ -69,7 +69,8 @@ void ComputeEventDisplace::init()
|
|||
|
||||
if (id_event != NULL) {
|
||||
int ifix = modify->find_fix(id_event);
|
||||
if (ifix < 0) error->all(FLERR,"Could not find compute event/displace fix ID");
|
||||
if (ifix < 0) error->all(FLERR,
|
||||
"Could not find compute event/displace fix ID");
|
||||
fix_event = (FixEvent*) modify->fix[ifix];
|
||||
|
||||
if (strcmp(fix_event->style,"EVENT/PRD") != 0 &&
|
||||
|
@ -145,7 +146,7 @@ double ComputeEventDisplace::compute_scalar()
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void ComputeEventDisplace::reset_extra_compute_fix(char *id_new)
|
||||
void ComputeEventDisplace::reset_extra_compute_fix(const char *id_new)
|
||||
{
|
||||
delete [] id_event;
|
||||
id_event = NULL;
|
||||
|
|
|
@ -30,7 +30,7 @@ class ComputeEventDisplace : public Compute {
|
|||
~ComputeEventDisplace();
|
||||
void init();
|
||||
double compute_scalar();
|
||||
void reset_extra_compute_fix(char *);
|
||||
void reset_extra_compute_fix(const char *);
|
||||
|
||||
private:
|
||||
int triclinic;
|
||||
|
|
|
@ -768,12 +768,12 @@ void PRD::options(int narg, char **arg)
|
|||
maxeval = 50;
|
||||
temp_flag = 0;
|
||||
|
||||
char *str = "geom";
|
||||
char *str = (char *) "geom";
|
||||
int n = strlen(str) + 1;
|
||||
loop_setting = new char[n];
|
||||
strcpy(loop_setting,str);
|
||||
|
||||
str = "gaussian";
|
||||
str = (char *) "gaussian";
|
||||
n = strlen(str) + 1;
|
||||
dist_setting = new char[n];
|
||||
strcpy(dist_setting,str);
|
||||
|
|
|
@ -932,16 +932,16 @@ void TAD::compute_tlo(int ievent)
|
|||
|
||||
// update first event
|
||||
|
||||
char* statstr = "D ";
|
||||
char* statstr = (char *) "D ";
|
||||
|
||||
if (ievent == 0) {
|
||||
deltfirst = deltlo;
|
||||
event_first = ievent;
|
||||
statstr = "DF";
|
||||
statstr = (char *) "DF";
|
||||
} else if (deltlo < deltfirst) {
|
||||
deltfirst = deltlo;
|
||||
event_first = ievent;
|
||||
statstr = "DF";
|
||||
statstr = (char *) "DF";
|
||||
}
|
||||
|
||||
// first-replica output about each event
|
||||
|
|
|
@ -175,8 +175,8 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) :
|
|||
|
||||
char **newarg = new char*[3];
|
||||
newarg[0] = id_temp;
|
||||
newarg[1] = "all";
|
||||
newarg[2] = "temp";
|
||||
newarg[1] = (char *) "all";
|
||||
newarg[2] = (char *) "temp";
|
||||
modify->add_compute(3,newarg);
|
||||
delete [] newarg;
|
||||
tflag = 1;
|
||||
|
@ -192,8 +192,8 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) :
|
|||
|
||||
newarg = new char*[4];
|
||||
newarg[0] = id_press;
|
||||
newarg[1] = "all";
|
||||
newarg[2] = "pressure";
|
||||
newarg[1] = (char *) "all";
|
||||
newarg[2] = (char *) "pressure";
|
||||
newarg[3] = id_temp;
|
||||
modify->add_compute(4,newarg);
|
||||
delete [] newarg;
|
||||
|
|
|
@ -44,7 +44,8 @@ Compute::Compute(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
|
|||
|
||||
for (int i = 0; i < n-1; i++)
|
||||
if (!isalnum(id[i]) && id[i] != '_')
|
||||
error->all(FLERR,"Compute ID must be alphanumeric or underscore characters");
|
||||
error->all(FLERR,
|
||||
"Compute ID must be alphanumeric or underscore characters");
|
||||
|
||||
igroup = group->find(arg[1]);
|
||||
if (igroup == -1) error->all(FLERR,"Could not find compute group ID");
|
||||
|
@ -135,9 +136,10 @@ void Compute::reset_extra_dof()
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void Compute::reset_extra_compute_fix(char *)
|
||||
void Compute::reset_extra_compute_fix(const char *)
|
||||
{
|
||||
error->all(FLERR,"Compute does not allow an extra compute or fix to be reset");
|
||||
error->all(FLERR,
|
||||
"Compute does not allow an extra compute or fix to be reset");
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
|
|
@ -103,7 +103,7 @@ class Compute : protected Pointers {
|
|||
virtual void restore_bias(int, double *) {}
|
||||
virtual void restore_bias_all() {}
|
||||
|
||||
virtual void reset_extra_compute_fix(char *);
|
||||
virtual void reset_extra_compute_fix(const char *);
|
||||
|
||||
void addstep(bigint);
|
||||
int matchstep(bigint);
|
||||
|
|
|
@ -277,7 +277,7 @@ void ComputePressure::virial_compute(int n, int ndiag)
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void ComputePressure::reset_extra_compute_fix(char *id_new)
|
||||
void ComputePressure::reset_extra_compute_fix(const char *id_new)
|
||||
{
|
||||
delete [] id_temp;
|
||||
int n = strlen(id_new) + 1;
|
||||
|
|
|
@ -31,7 +31,7 @@ class ComputePressure : public Compute {
|
|||
void init();
|
||||
double compute_scalar();
|
||||
void compute_vector();
|
||||
void reset_extra_compute_fix(char *);
|
||||
void reset_extra_compute_fix(const char *);
|
||||
|
||||
protected:
|
||||
double boltz,nktv2p,inv_volume;
|
||||
|
|
|
@ -74,13 +74,13 @@ void DumpAtom::init_style()
|
|||
// setup column string
|
||||
|
||||
if (scale_flag == 0 && image_flag == 0)
|
||||
columns = "id type x y z";
|
||||
columns = (char *) "id type x y z";
|
||||
else if (scale_flag == 0 && image_flag == 1)
|
||||
columns = "id type x y z ix iy iz";
|
||||
columns = (char *) "id type x y z ix iy iz";
|
||||
else if (scale_flag == 1 && image_flag == 0)
|
||||
columns = "id type xs ys zs";
|
||||
columns = (char *) "id type xs ys zs";
|
||||
else if (scale_flag == 1 && image_flag == 1)
|
||||
columns = "id type xs ys zs ix iy iz";
|
||||
columns = (char *) "id type xs ys zs ix iy iz";
|
||||
|
||||
// setup function ptrs
|
||||
|
||||
|
|
|
@ -1833,9 +1833,9 @@ double *DumpImage::value2color(double value)
|
|||
search user-defined color names first, then the list of NCOLORS names
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
double *DumpImage::color2rgb(char *color)
|
||||
double *DumpImage::color2rgb(const char *color)
|
||||
{
|
||||
static char *name[NCOLORS] = {
|
||||
static const char *name[NCOLORS] = {
|
||||
"aliceblue",
|
||||
"antiquewhite",
|
||||
"aqua",
|
||||
|
@ -2136,8 +2136,7 @@ double *DumpImage::color2rgb(char *color)
|
|||
|
||||
double *DumpImage::element2color(char *element)
|
||||
{
|
||||
|
||||
static char *name[NELEMENTS] = {
|
||||
static const char *name[NELEMENTS] = {
|
||||
"H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne",
|
||||
"Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca",
|
||||
"Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn",
|
||||
|
@ -2276,7 +2275,7 @@ double *DumpImage::element2color(char *element)
|
|||
|
||||
double DumpImage::element2diam(char *element)
|
||||
{
|
||||
static char *name[NELEMENTS] = {
|
||||
static const char *name[NELEMENTS] = {
|
||||
"H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne",
|
||||
"Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca",
|
||||
"Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn",
|
||||
|
|
|
@ -152,7 +152,7 @@ class DumpImage : public DumpCustom {
|
|||
void write_PPM();
|
||||
|
||||
double *value2color(double);
|
||||
double *color2rgb(char *);
|
||||
double *color2rgb(const char *);
|
||||
double *element2color(char *);
|
||||
double element2diam(char *);
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ DumpLocal::DumpLocal(LAMMPS *lmp, int narg, char **arg) :
|
|||
|
||||
// setup default label string
|
||||
|
||||
char *str = "ENTRIES";
|
||||
char *str = (char *) "ENTRIES";
|
||||
n = strlen(str) + 1;
|
||||
label = new char[n];
|
||||
strcpy(label,str);
|
||||
|
|
|
@ -129,7 +129,7 @@ void Error::warning(const char *file, int line, const char *str, int logflag)
|
|||
write message to screen and logfile (if logflag is set)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Error::message(const char *file, int line, char *str, int logflag)
|
||||
void Error::message(const char *file, int line, const char *str, int logflag)
|
||||
{
|
||||
if (screen) fprintf(screen,"%s (%s:%d)\n",str,file,line);
|
||||
if (logflag && logfile) fprintf(logfile,"%s (%s:%d)\n",str,file,line);
|
||||
|
|
|
@ -28,7 +28,7 @@ class Error : protected Pointers {
|
|||
void all(const char *, int, const char *);
|
||||
void one(const char *, int, const char *);
|
||||
void warning(const char *, int, const char *, int = 1);
|
||||
void message(const char *, int, char *, int = 1);
|
||||
void message(const char *, int, const char *, int = 1);
|
||||
void done();
|
||||
};
|
||||
|
||||
|
|
|
@ -1167,9 +1167,9 @@ void Input::package()
|
|||
|
||||
} else if (strcmp(arg[0],"gpu") == 0) {
|
||||
char **fixarg = new char*[2+narg];
|
||||
fixarg[0] = "package_gpu";
|
||||
fixarg[1] = "all";
|
||||
fixarg[2] = "GPU";
|
||||
fixarg[0] = (char *) "package_gpu";
|
||||
fixarg[1] = (char *) "all";
|
||||
fixarg[2] = (char *) "GPU";
|
||||
for (int i = 1; i < narg; i++) fixarg[i+2] = arg[i];
|
||||
modify->allow_early_fix = 1;
|
||||
modify->add_fix(2+narg,fixarg,NULL);
|
||||
|
@ -1178,9 +1178,9 @@ void Input::package()
|
|||
|
||||
} else if (strcmp(arg[0],"omp") == 0) {
|
||||
char **fixarg = new char*[2+narg];
|
||||
fixarg[0] = "package_omp";
|
||||
fixarg[1] = "all";
|
||||
fixarg[2] = "OMP";
|
||||
fixarg[0] = (char *) "package_omp";
|
||||
fixarg[1] = (char *) "all";
|
||||
fixarg[2] = (char *) "OMP";
|
||||
for (int i = 1; i < narg; i++) fixarg[i+2] = arg[i];
|
||||
modify->allow_early_fix = 1;
|
||||
modify->add_fix(2+narg,fixarg,NULL);
|
||||
|
|
|
@ -73,7 +73,7 @@ void KSpace::modify_params(int narg, char **arg)
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void *KSpace::extract(char *str)
|
||||
void *KSpace::extract(const char *str)
|
||||
{
|
||||
if (strcmp(str,"scale") == 0) return (void *) &scale;
|
||||
return NULL;
|
||||
|
|
|
@ -29,7 +29,7 @@ class KSpace : protected Pointers {
|
|||
KSpace(class LAMMPS *, int, char **);
|
||||
virtual ~KSpace() {}
|
||||
void modify_params(int, char **);
|
||||
void *extract(char *);
|
||||
void *extract(const char *);
|
||||
|
||||
virtual void init() = 0;
|
||||
virtual void setup() = 0;
|
||||
|
|
22
src/min.cpp
22
src/min.cpp
|
@ -750,15 +750,15 @@ double Min::fnorm_inf()
|
|||
|
||||
char *Min::stopstrings(int n)
|
||||
{
|
||||
char *strings[] = {"max iterations",
|
||||
"max force evaluations",
|
||||
"energy tolerance",
|
||||
"force tolerance",
|
||||
"search direction is not downhill",
|
||||
"linesearch alpha is zero",
|
||||
"forces are zero",
|
||||
"quadratic factors are zero",
|
||||
"trust region too small",
|
||||
"HFTN minimizer error"};
|
||||
return strings[n];
|
||||
const char *strings[] = {"max iterations",
|
||||
"max force evaluations",
|
||||
"energy tolerance",
|
||||
"force tolerance",
|
||||
"search direction is not downhill",
|
||||
"linesearch alpha is zero",
|
||||
"forces are zero",
|
||||
"quadratic factors are zero",
|
||||
"trust region too small",
|
||||
"HFTN minimizer error"};
|
||||
return (char *) strings[n];
|
||||
}
|
||||
|
|
|
@ -839,7 +839,7 @@ void Modify::modify_compute(int narg, char **arg)
|
|||
delete a Compute from list of Computes
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Modify::delete_compute(char *id)
|
||||
void Modify::delete_compute(const char *id)
|
||||
{
|
||||
int icompute = find_compute(id);
|
||||
if (icompute < 0) error->all(FLERR,"Could not find compute ID to delete");
|
||||
|
@ -856,7 +856,7 @@ void Modify::delete_compute(char *id)
|
|||
return index of compute or -1 if not found
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int Modify::find_compute(char *id)
|
||||
int Modify::find_compute(const char *id)
|
||||
{
|
||||
int icompute;
|
||||
for (icompute = 0; icompute < ncompute; icompute++)
|
||||
|
|
|
@ -88,8 +88,8 @@ class Modify : protected Pointers {
|
|||
|
||||
void add_compute(int, char **, char *suffix = NULL);
|
||||
void modify_compute(int, char **);
|
||||
void delete_compute(char *);
|
||||
int find_compute(char *);
|
||||
void delete_compute(const char *);
|
||||
int find_compute(const char *);
|
||||
void clearstep_compute();
|
||||
void addstep_compute(bigint);
|
||||
void addstep_compute_all(bigint);
|
||||
|
|
|
@ -120,7 +120,7 @@ class Pair : protected Pointers {
|
|||
|
||||
// specific child-class methods for certain Pair styles
|
||||
|
||||
virtual void *extract(char *, int &) {return NULL;}
|
||||
virtual void *extract(const char *, int &) {return NULL;}
|
||||
virtual void swap_eam(double *, double **) {}
|
||||
virtual void reset_dt() {}
|
||||
virtual void min_xf_pointers(int, double **, double **) {}
|
||||
|
|
|
@ -399,7 +399,7 @@ double PairBorn::single(int i, int j, int itype, int jtype,
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void *PairBorn::extract(char *str, int &dim)
|
||||
void *PairBorn::extract(const char *str, int &dim)
|
||||
{
|
||||
dim = 2;
|
||||
if (strcmp(str,"a") == 0) return (void *) a;
|
||||
|
|
|
@ -38,7 +38,7 @@ class PairBorn : public Pair {
|
|||
void write_restart_settings(FILE *);
|
||||
void read_restart_settings(FILE *);
|
||||
double single(int, int, int, int, double, double, double, double &);
|
||||
void *extract(char *, int &);
|
||||
void *extract(const char *, int &);
|
||||
|
||||
protected:
|
||||
double cut_global;
|
||||
|
|
|
@ -369,7 +369,7 @@ double PairBuck::single(int i, int j, int itype, int jtype,
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void *PairBuck::extract(char *str, int &dim)
|
||||
void *PairBuck::extract(const char *str, int &dim)
|
||||
{
|
||||
dim = 2;
|
||||
if (strcmp(str,"a") == 0) return (void *) a;
|
||||
|
|
|
@ -37,7 +37,7 @@ class PairBuck : public Pair {
|
|||
void write_restart_settings(FILE *);
|
||||
void read_restart_settings(FILE *);
|
||||
double single(int, int, int, int, double, double, double, double &);
|
||||
void *extract(char *, int &);
|
||||
void *extract(const char *, int &);
|
||||
|
||||
protected:
|
||||
double cut_global;
|
||||
|
|
|
@ -300,7 +300,7 @@ double PairCoulCut::single(int i, int j, int itype, int jtype,
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void *PairCoulCut::extract(char *str, int &dim)
|
||||
void *PairCoulCut::extract(const char *str, int &dim)
|
||||
{
|
||||
dim = 2;
|
||||
if (strcmp(str,"scale") == 0) return (void *) scale;
|
||||
|
|
|
@ -38,7 +38,7 @@ class PairCoulCut : public Pair {
|
|||
virtual void write_restart_settings(FILE *);
|
||||
virtual void read_restart_settings(FILE *);
|
||||
virtual double single(int, int, int, int, double, double, double, double &);
|
||||
void *extract(char *, int &);
|
||||
void *extract(const char *, int &);
|
||||
|
||||
protected:
|
||||
double cut_global;
|
||||
|
|
|
@ -327,7 +327,7 @@ double PairGauss::single(int i, int j, int itype, int jtype, double rsq,
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void *PairGauss::extract(char *str, int &dim)
|
||||
void *PairGauss::extract(const char *str, int &dim)
|
||||
{
|
||||
dim = 2;
|
||||
if (strcmp(str,"a") == 0) return (void *) a;
|
||||
|
|
|
@ -37,7 +37,7 @@ class PairGauss : public Pair {
|
|||
void write_restart_settings(FILE *);
|
||||
void read_restart_settings(FILE *);
|
||||
double single(int, int, int, int, double, double, double, double &);
|
||||
void *extract(char *, int &);
|
||||
void *extract(const char *, int &);
|
||||
|
||||
protected:
|
||||
double cut_global;
|
||||
|
|
|
@ -676,7 +676,7 @@ double PairHybrid::memory_usage()
|
|||
for cut_coul, insure all non-NULL results are equal since required by Kspace
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void *PairHybrid::extract(char *str, int &dim)
|
||||
void *PairHybrid::extract(const char *str, int &dim)
|
||||
{
|
||||
void *cutptr = NULL;
|
||||
void *ptr;
|
||||
|
|
|
@ -47,7 +47,7 @@ class PairHybrid : public Pair {
|
|||
void compute_inner();
|
||||
void compute_middle();
|
||||
void compute_outer(int, int);
|
||||
void *extract(char *, int &);
|
||||
void *extract(const char *, int &);
|
||||
void reset_dt();
|
||||
|
||||
int check_ijtype(int, int, char *);
|
||||
|
|
|
@ -696,7 +696,7 @@ double PairLJCut::single(int i, int j, int itype, int jtype, double rsq,
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void *PairLJCut::extract(char *str, int &dim)
|
||||
void *PairLJCut::extract(const char *str, int &dim)
|
||||
{
|
||||
dim = 2;
|
||||
if (strcmp(str,"epsilon") == 0) return (void *) epsilon;
|
||||
|
|
|
@ -39,7 +39,7 @@ class PairLJCut : public Pair {
|
|||
void write_restart_settings(FILE *);
|
||||
void read_restart_settings(FILE *);
|
||||
double single(int, int, int, int, double, double, double, double &);
|
||||
void *extract(char *, int &);
|
||||
void *extract(const char *, int &);
|
||||
|
||||
void compute_inner();
|
||||
void compute_middle();
|
||||
|
|
|
@ -299,7 +299,7 @@ double PairSoft::single(int i, int j, int itype, int jtype, double rsq,
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void *PairSoft::extract(char *str, int &dim)
|
||||
void *PairSoft::extract(const char *str, int &dim)
|
||||
{
|
||||
dim = 2;
|
||||
if (strcmp(str,"a") == 0) return (void *) prefactor;
|
||||
|
|
|
@ -40,7 +40,7 @@ class PairSoft : public Pair {
|
|||
void write_restart_settings(FILE *);
|
||||
void read_restart_settings(FILE *);
|
||||
double single(int, int, int, int, double, double, double, double &);
|
||||
void *extract(char *, int &);
|
||||
void *extract(const char *, int &);
|
||||
|
||||
protected:
|
||||
double cut_global;
|
||||
|
|
|
@ -947,7 +947,7 @@ double PairTable::single(int i, int j, int itype, int jtype, double rsq,
|
|||
no way to know which tables are active since pair::init() not yet called
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void *PairTable::extract(char *str, int &dim)
|
||||
void *PairTable::extract(const char *str, int &dim)
|
||||
{
|
||||
if (strcmp(str,"cut_coul") != 0) return NULL;
|
||||
if (ntables == 0) error->all(FLERR,"All pair coeffs are not set");
|
||||
|
@ -955,7 +955,8 @@ void *PairTable::extract(char *str, int &dim)
|
|||
double cut_coul = tables[0].cut;
|
||||
for (int m = 1; m < ntables; m++)
|
||||
if (tables[m].cut != cut_coul)
|
||||
error->all(FLERR,"Pair table cutoffs must all be equal to use with KSpace");
|
||||
error->all(FLERR,
|
||||
"Pair table cutoffs must all be equal to use with KSpace");
|
||||
dim = 0;
|
||||
return &tables[0].cut;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ class PairTable : public Pair {
|
|||
void write_restart_settings(FILE *);
|
||||
void read_restart_settings(FILE *);
|
||||
double single(int, int, int, int, double, double, double, double &);
|
||||
void *extract(char *, int &);
|
||||
void *extract(const char *, int &);
|
||||
|
||||
protected:
|
||||
int tabstyle,tablength;
|
||||
|
|
|
@ -325,7 +325,7 @@ void ReadData::header(int flag)
|
|||
|
||||
// customize for new sections
|
||||
|
||||
char *section_keywords[NSECTIONS] =
|
||||
const char *section_keywords[NSECTIONS] =
|
||||
{"Atoms","Velocities","Ellipsoids","Lines","Triangles",
|
||||
"Bonds","Angles","Dihedrals","Impropers",
|
||||
"Masses","Pair Coeffs","Bond Coeffs","Angle Coeffs",
|
||||
|
@ -604,7 +604,7 @@ void ReadData::velocities()
|
|||
to find atoms, must build atom map if not a molecular system
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void ReadData::bonus(bigint nbonus, AtomVec *ptr, char *type)
|
||||
void ReadData::bonus(bigint nbonus, AtomVec *ptr, const char *type)
|
||||
{
|
||||
int i,m,nchunk;
|
||||
|
||||
|
@ -1426,7 +1426,7 @@ void ReadData::skip_lines(int n)
|
|||
if dupflag, duplicate 1st word, so pair_coeff "2" becomes "2 2"
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void ReadData::parse_coeffs(char *line, char *addstr, int dupflag)
|
||||
void ReadData::parse_coeffs(char *line, const char *addstr, int dupflag)
|
||||
{
|
||||
char *ptr;
|
||||
if (ptr = strchr(line,'#')) *ptr = '\0';
|
||||
|
@ -1439,9 +1439,9 @@ void ReadData::parse_coeffs(char *line, char *addstr, int dupflag)
|
|||
arg = (char **)
|
||||
memory->srealloc(arg,maxarg*sizeof(char *),"read_data:arg");
|
||||
}
|
||||
if (addstr && narg == 1 && !islower(word[0])) arg[narg++] = addstr;
|
||||
if (addstr && narg == 1 && !islower(word[0])) arg[narg++] = (char *) addstr;
|
||||
arg[narg++] = word;
|
||||
if (addstr && narg == 2 && islower(word[0])) arg[narg++] = addstr;
|
||||
if (addstr && narg == 2 && islower(word[0])) arg[narg++] = (char *) addstr;
|
||||
if (dupflag && narg == 1) arg[narg++] = word;
|
||||
word = strtok(NULL," \t\n\r\f");
|
||||
}
|
||||
|
|
|
@ -51,11 +51,11 @@ class ReadData : protected Pointers {
|
|||
void header(int);
|
||||
void parse_keyword(int, int);
|
||||
void skip_lines(int);
|
||||
void parse_coeffs(char *, char *, int);
|
||||
void parse_coeffs(char *, const char *, int);
|
||||
|
||||
void atoms();
|
||||
void velocities();
|
||||
void bonus(bigint, class AtomVec *, char *);
|
||||
void bonus(bigint, class AtomVec *, const char *);
|
||||
|
||||
void bonds();
|
||||
void angles();
|
||||
|
|
|
@ -134,7 +134,7 @@ Thermo::Thermo(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
|
|||
|
||||
// format strings
|
||||
|
||||
char *bigint_format = BIGINT_FORMAT;
|
||||
char *bigint_format = (char *) BIGINT_FORMAT;
|
||||
char *fformat_multi = (char *) "---------------- Step %%8%s ----- "
|
||||
"CPU = %%11.4f (sec) ----------------";
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ void Velocity::command(int narg, char **arg)
|
|||
initialization of defaults before calling velocity methods externaly
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Velocity::init_external(char *extgroup)
|
||||
void Velocity::init_external(const char *extgroup)
|
||||
{
|
||||
igroup = group->find(extgroup);
|
||||
if (igroup == -1) error->all(FLERR,"Could not find velocity group ID");
|
||||
|
|
|
@ -28,7 +28,7 @@ class Velocity : protected Pointers {
|
|||
public:
|
||||
Velocity(class LAMMPS *);
|
||||
void command(int, char **);
|
||||
void init_external(char *);
|
||||
void init_external(const char *);
|
||||
void options(int, char **);
|
||||
void create(double, int);
|
||||
|
||||
|
|
Loading…
Reference in New Issue