2007-10-04 00:15:35 +08:00
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
|
|
|
http://lammps.sandia.gov, Sandia National Laboratories
|
|
|
|
Steve Plimpton, sjplimp@sandia.gov
|
|
|
|
|
|
|
|
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
|
|
|
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
2012-06-07 06:47:51 +08:00
|
|
|
certain rights in this software. This software is distributed under
|
2007-10-04 00:15:35 +08:00
|
|
|
the GNU General Public License.
|
|
|
|
|
|
|
|
See the README file in the top-level LAMMPS directory.
|
|
|
|
------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
Contributing author: Paul Crozier (SNL)
|
|
|
|
------------------------------------------------------------------------- */
|
|
|
|
|
2019-07-04 07:44:58 +08:00
|
|
|
#include "pair_coul_long.h"
|
2019-07-06 22:20:13 +08:00
|
|
|
#include <mpi.h>
|
2018-04-28 05:41:04 +08:00
|
|
|
#include <cmath>
|
|
|
|
#include <cstring>
|
2007-10-04 00:15:35 +08:00
|
|
|
#include "atom.h"
|
|
|
|
#include "comm.h"
|
|
|
|
#include "force.h"
|
|
|
|
#include "kspace.h"
|
|
|
|
#include "neighbor.h"
|
|
|
|
#include "neigh_list.h"
|
|
|
|
#include "memory.h"
|
|
|
|
#include "error.h"
|
2019-10-18 01:18:02 +08:00
|
|
|
#include "utils.h"
|
2007-10-04 00:15:35 +08:00
|
|
|
|
|
|
|
using namespace LAMMPS_NS;
|
|
|
|
|
|
|
|
#define EWALD_F 1.12837917
|
|
|
|
#define EWALD_P 0.3275911
|
|
|
|
#define A1 0.254829592
|
|
|
|
#define A2 -0.284496736
|
|
|
|
#define A3 1.421413741
|
|
|
|
#define A4 -1.453152027
|
|
|
|
#define A5 1.061405429
|
|
|
|
|
|
|
|
/* ---------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
PairCoulLong::PairCoulLong(LAMMPS *lmp) : Pair(lmp)
|
|
|
|
{
|
2012-10-03 04:11:55 +08:00
|
|
|
ewaldflag = pppmflag = 1;
|
2007-10-04 00:15:35 +08:00
|
|
|
ftable = NULL;
|
2013-07-23 23:18:51 +08:00
|
|
|
qdist = 0.0;
|
2020-02-15 04:51:38 +08:00
|
|
|
cut_respa = NULL;
|
2007-10-04 00:15:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ---------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
PairCoulLong::~PairCoulLong()
|
|
|
|
{
|
2019-03-22 16:55:58 +08:00
|
|
|
if (copymode) return;
|
|
|
|
|
|
|
|
if (allocated) {
|
|
|
|
memory->destroy(setflag);
|
|
|
|
memory->destroy(cutsq);
|
|
|
|
|
|
|
|
memory->destroy(scale);
|
2007-10-04 00:15:35 +08:00
|
|
|
}
|
2019-03-22 16:55:58 +08:00
|
|
|
if (ftable) free_tables();
|
2007-10-04 00:15:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ---------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
void PairCoulLong::compute(int eflag, int vflag)
|
|
|
|
{
|
2010-10-23 05:25:05 +08:00
|
|
|
int i,j,ii,jj,inum,jnum,itable,itype,jtype;
|
2007-12-07 08:11:14 +08:00
|
|
|
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,ecoul,fpair;
|
2007-12-01 05:54:30 +08:00
|
|
|
double fraction,table;
|
|
|
|
double r,r2inv,forcecoul,factor_coul;
|
2007-10-04 00:15:35 +08:00
|
|
|
double grij,expm2,prefactor,t,erfc;
|
|
|
|
int *ilist,*jlist,*numneigh,**firstneigh;
|
2009-10-30 05:50:07 +08:00
|
|
|
double rsq;
|
2007-10-04 00:15:35 +08:00
|
|
|
|
2007-12-01 05:54:30 +08:00
|
|
|
ecoul = 0.0;
|
2019-03-13 23:34:15 +08:00
|
|
|
ev_init(eflag,vflag);
|
2007-10-04 00:15:35 +08:00
|
|
|
|
|
|
|
double **x = atom->x;
|
|
|
|
double **f = atom->f;
|
|
|
|
double *q = atom->q;
|
2010-10-23 05:25:05 +08:00
|
|
|
int *type = atom->type;
|
2007-10-04 00:15:35 +08:00
|
|
|
int nlocal = atom->nlocal;
|
|
|
|
double *special_coul = force->special_coul;
|
|
|
|
int newton_pair = force->newton_pair;
|
|
|
|
double qqrd2e = force->qqrd2e;
|
|
|
|
|
|
|
|
inum = list->inum;
|
|
|
|
ilist = list->ilist;
|
|
|
|
numneigh = list->numneigh;
|
|
|
|
firstneigh = list->firstneigh;
|
2012-06-07 06:47:51 +08:00
|
|
|
|
2007-10-04 00:15:35 +08:00
|
|
|
// loop over neighbors of my atoms
|
|
|
|
|
|
|
|
for (ii = 0; ii < inum; ii++) {
|
|
|
|
i = ilist[ii];
|
|
|
|
qtmp = q[i];
|
|
|
|
xtmp = x[i][0];
|
|
|
|
ytmp = x[i][1];
|
|
|
|
ztmp = x[i][2];
|
2010-10-23 05:25:05 +08:00
|
|
|
itype = type[i];
|
2007-10-04 00:15:35 +08:00
|
|
|
jlist = firstneigh[i];
|
|
|
|
jnum = numneigh[i];
|
|
|
|
|
|
|
|
for (jj = 0; jj < jnum; jj++) {
|
|
|
|
j = jlist[jj];
|
2011-04-06 03:10:43 +08:00
|
|
|
factor_coul = special_coul[sbmask(j)];
|
|
|
|
j &= NEIGHMASK;
|
2007-10-04 00:15:35 +08:00
|
|
|
|
|
|
|
delx = xtmp - x[j][0];
|
|
|
|
dely = ytmp - x[j][1];
|
|
|
|
delz = ztmp - x[j][2];
|
|
|
|
rsq = delx*delx + dely*dely + delz*delz;
|
2010-10-23 05:25:05 +08:00
|
|
|
jtype = type[j];
|
2009-10-30 05:50:07 +08:00
|
|
|
|
2010-10-23 05:25:05 +08:00
|
|
|
if (rsq < cut_coulsq) {
|
2012-06-07 06:47:51 +08:00
|
|
|
r2inv = 1.0/rsq;
|
|
|
|
if (!ncoultablebits || rsq <= tabinnersq) {
|
|
|
|
r = sqrt(rsq);
|
|
|
|
grij = g_ewald * r;
|
|
|
|
expm2 = exp(-grij*grij);
|
|
|
|
t = 1.0 / (1.0 + EWALD_P*grij);
|
|
|
|
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
|
|
|
|
prefactor = qqrd2e * scale[itype][jtype] * qtmp*q[j]/r;
|
|
|
|
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
|
|
|
|
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
|
|
|
|
} else {
|
|
|
|
union_int_float_t rsq_lookup;
|
|
|
|
rsq_lookup.f = rsq;
|
|
|
|
itable = rsq_lookup.i & ncoulmask;
|
|
|
|
itable >>= ncoulshiftbits;
|
|
|
|
fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
|
|
|
|
table = ftable[itable] + fraction*dftable[itable];
|
|
|
|
forcecoul = scale[itype][jtype] * qtmp*q[j] * table;
|
|
|
|
if (factor_coul < 1.0) {
|
|
|
|
table = ctable[itable] + fraction*dctable[itable];
|
|
|
|
prefactor = scale[itype][jtype] * qtmp*q[j] * table;
|
|
|
|
forcecoul -= (1.0-factor_coul)*prefactor;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fpair = forcecoul * r2inv;
|
|
|
|
|
|
|
|
f[i][0] += delx*fpair;
|
|
|
|
f[i][1] += dely*fpair;
|
|
|
|
f[i][2] += delz*fpair;
|
|
|
|
if (newton_pair || j < nlocal) {
|
|
|
|
f[j][0] -= delx*fpair;
|
|
|
|
f[j][1] -= dely*fpair;
|
|
|
|
f[j][2] -= delz*fpair;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (eflag) {
|
|
|
|
if (!ncoultablebits || rsq <= tabinnersq)
|
|
|
|
ecoul = prefactor*erfc;
|
|
|
|
else {
|
|
|
|
table = etable[itable] + fraction*detable[itable];
|
|
|
|
ecoul = scale[itype][jtype] * qtmp*q[j] * table;
|
|
|
|
}
|
|
|
|
if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (evflag) ev_tally(i,j,nlocal,newton_pair,
|
|
|
|
0.0,ecoul,fpair,delx,dely,delz);
|
2007-10-04 00:15:35 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2007-12-01 05:54:30 +08:00
|
|
|
|
2011-06-08 02:06:14 +08:00
|
|
|
if (vflag_fdotr) virial_fdotr_compute();
|
2007-10-04 00:15:35 +08:00
|
|
|
}
|
2007-12-01 05:54:30 +08:00
|
|
|
|
2007-10-04 00:15:35 +08:00
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
allocate all arrays
|
|
|
|
------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
void PairCoulLong::allocate()
|
|
|
|
{
|
|
|
|
allocated = 1;
|
|
|
|
int n = atom->ntypes;
|
|
|
|
|
2011-03-26 05:13:51 +08:00
|
|
|
memory->create(setflag,n+1,n+1,"pair:setflag");
|
2007-10-04 00:15:35 +08:00
|
|
|
for (int i = 1; i <= n; i++)
|
|
|
|
for (int j = i; j <= n; j++)
|
|
|
|
setflag[i][j] = 0;
|
|
|
|
|
2011-03-26 05:13:51 +08:00
|
|
|
memory->create(cutsq,n+1,n+1,"pair:cutsq");
|
2010-10-23 05:25:05 +08:00
|
|
|
|
2011-03-26 05:13:51 +08:00
|
|
|
memory->create(scale,n+1,n+1,"pair:scale");
|
2007-10-04 00:15:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
global settings
|
|
|
|
------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
void PairCoulLong::settings(int narg, char **arg)
|
|
|
|
{
|
2011-09-24 02:06:55 +08:00
|
|
|
if (narg != 1) error->all(FLERR,"Illegal pair_style command");
|
2007-10-04 00:15:35 +08:00
|
|
|
|
2013-06-28 04:02:55 +08:00
|
|
|
cut_coul = force->numeric(FLERR,arg[0]);
|
2007-10-04 00:15:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
set coeffs for one or more type pairs
|
|
|
|
------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
void PairCoulLong::coeff(int narg, char **arg)
|
|
|
|
{
|
2011-09-24 02:06:55 +08:00
|
|
|
if (narg != 2) error->all(FLERR,"Incorrect args for pair coefficients");
|
2007-10-04 00:15:35 +08:00
|
|
|
if (!allocated) allocate();
|
|
|
|
|
|
|
|
int ilo,ihi,jlo,jhi;
|
2016-10-27 03:53:02 +08:00
|
|
|
force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi);
|
|
|
|
force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi);
|
2007-10-04 00:15:35 +08:00
|
|
|
|
|
|
|
int count = 0;
|
|
|
|
for (int i = ilo; i <= ihi; i++) {
|
|
|
|
for (int j = MAX(jlo,i); j <= jhi; j++) {
|
2010-10-23 05:25:05 +08:00
|
|
|
scale[i][j] = 1.0;
|
2007-10-04 00:15:35 +08:00
|
|
|
setflag[i][j] = 1;
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-09-24 02:06:55 +08:00
|
|
|
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
|
2007-10-04 00:15:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
init specific to this pair style
|
|
|
|
------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
void PairCoulLong::init_style()
|
|
|
|
{
|
|
|
|
if (!atom->q_flag)
|
2011-09-24 02:06:55 +08:00
|
|
|
error->all(FLERR,"Pair style lj/cut/coul/long requires atom attribute q");
|
2007-10-04 00:15:35 +08:00
|
|
|
|
2015-01-20 07:49:20 +08:00
|
|
|
neighbor->request(this,instance_me);
|
2007-10-04 00:15:35 +08:00
|
|
|
|
|
|
|
cut_coulsq = cut_coul * cut_coul;
|
|
|
|
|
|
|
|
// insure use of KSpace long-range solver, set g_ewald
|
|
|
|
|
2012-06-07 06:47:51 +08:00
|
|
|
if (force->kspace == NULL)
|
2012-10-03 04:11:55 +08:00
|
|
|
error->all(FLERR,"Pair style requires a KSpace style");
|
2007-10-05 01:57:04 +08:00
|
|
|
g_ewald = force->kspace->g_ewald;
|
2007-10-04 00:15:35 +08:00
|
|
|
|
|
|
|
// setup force tables
|
|
|
|
|
2012-11-13 05:12:26 +08:00
|
|
|
if (ncoultablebits) init_tables(cut_coul,NULL);
|
2007-10-04 00:15:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
init for one type pair i,j and corresponding j,i
|
|
|
|
------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
double PairCoulLong::init_one(int i, int j)
|
|
|
|
{
|
2010-11-25 08:03:33 +08:00
|
|
|
scale[j][i] = scale[i][j];
|
2013-07-23 23:18:51 +08:00
|
|
|
return cut_coul+2.0*qdist;
|
2007-10-04 00:15:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
proc 0 writes to restart file
|
|
|
|
------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
void PairCoulLong::write_restart(FILE *fp)
|
|
|
|
{
|
|
|
|
write_restart_settings(fp);
|
2015-05-14 22:42:02 +08:00
|
|
|
|
|
|
|
for (int i = 1; i <= atom->ntypes; i++)
|
|
|
|
for (int j = i; j <= atom->ntypes; j++) {
|
|
|
|
fwrite(&setflag[i][j],sizeof(int),1,fp);
|
|
|
|
if (setflag[i][j])
|
|
|
|
fwrite(&scale[i][j],sizeof(double),1,fp);
|
|
|
|
}
|
2007-10-04 00:15:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
proc 0 reads from restart file, bcasts
|
|
|
|
------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
void PairCoulLong::read_restart(FILE *fp)
|
|
|
|
{
|
|
|
|
read_restart_settings(fp);
|
|
|
|
|
|
|
|
allocate();
|
2015-05-14 22:42:02 +08:00
|
|
|
|
|
|
|
int i,j;
|
|
|
|
int me = comm->me;
|
|
|
|
for (i = 1; i <= atom->ntypes; i++)
|
|
|
|
for (j = i; j <= atom->ntypes; j++) {
|
2019-10-18 01:18:02 +08:00
|
|
|
if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error);
|
2015-05-14 22:42:02 +08:00
|
|
|
MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
|
|
|
|
if (setflag[i][j]) {
|
2019-10-18 01:18:02 +08:00
|
|
|
if (me == 0) utils::sfread(FLERR,&scale[i][j],sizeof(double),1,fp,NULL,error);
|
2015-05-14 22:42:02 +08:00
|
|
|
MPI_Bcast(&scale[i][j],1,MPI_DOUBLE,0,world);
|
|
|
|
}
|
|
|
|
}
|
2007-10-04 00:15:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
proc 0 writes to restart file
|
|
|
|
------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
void PairCoulLong::write_restart_settings(FILE *fp)
|
|
|
|
{
|
|
|
|
fwrite(&cut_coul,sizeof(double),1,fp);
|
|
|
|
fwrite(&offset_flag,sizeof(int),1,fp);
|
|
|
|
fwrite(&mix_flag,sizeof(int),1,fp);
|
2012-10-05 23:21:35 +08:00
|
|
|
fwrite(&ncoultablebits,sizeof(int),1,fp);
|
|
|
|
fwrite(&tabinner,sizeof(double),1,fp);
|
2007-10-04 00:15:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
proc 0 reads from restart file, bcasts
|
|
|
|
------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
void PairCoulLong::read_restart_settings(FILE *fp)
|
|
|
|
{
|
|
|
|
if (comm->me == 0) {
|
2019-10-18 01:18:02 +08:00
|
|
|
utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error);
|
|
|
|
utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error);
|
|
|
|
utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error);
|
|
|
|
utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error);
|
|
|
|
utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error);
|
2007-10-04 00:15:35 +08:00
|
|
|
}
|
|
|
|
MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world);
|
|
|
|
MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
|
|
|
|
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
|
2012-10-05 23:21:35 +08:00
|
|
|
MPI_Bcast(&ncoultablebits,1,MPI_INT,0,world);
|
|
|
|
MPI_Bcast(&tabinner,1,MPI_DOUBLE,0,world);
|
2007-10-04 00:15:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ---------------------------------------------------------------------- */
|
|
|
|
|
2018-08-24 23:51:38 +08:00
|
|
|
double PairCoulLong::single(int i, int j, int /*itype*/, int /*jtype*/,
|
2012-06-07 06:47:51 +08:00
|
|
|
double rsq,
|
2018-08-24 23:51:38 +08:00
|
|
|
double factor_coul, double /*factor_lj*/,
|
2012-06-07 06:47:51 +08:00
|
|
|
double &fforce)
|
2007-10-04 00:15:35 +08:00
|
|
|
{
|
|
|
|
double r2inv,r,grij,expm2,t,erfc,prefactor;
|
|
|
|
double fraction,table,forcecoul,phicoul;
|
|
|
|
int itable;
|
|
|
|
|
|
|
|
r2inv = 1.0/rsq;
|
|
|
|
if (!ncoultablebits || rsq <= tabinnersq) {
|
|
|
|
r = sqrt(rsq);
|
|
|
|
grij = g_ewald * r;
|
|
|
|
expm2 = exp(-grij*grij);
|
|
|
|
t = 1.0 / (1.0 + EWALD_P*grij);
|
|
|
|
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
|
|
|
|
prefactor = force->qqrd2e * atom->q[i]*atom->q[j]/r;
|
|
|
|
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
|
|
|
|
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
|
|
|
|
} else {
|
2009-10-30 06:03:02 +08:00
|
|
|
union_int_float_t rsq_lookup;
|
2009-10-30 05:50:07 +08:00
|
|
|
rsq_lookup.f = rsq;
|
|
|
|
itable = rsq_lookup.i & ncoulmask;
|
2007-10-04 00:15:35 +08:00
|
|
|
itable >>= ncoulshiftbits;
|
2009-10-30 05:50:07 +08:00
|
|
|
fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
|
2007-10-04 00:15:35 +08:00
|
|
|
table = ftable[itable] + fraction*dftable[itable];
|
|
|
|
forcecoul = atom->q[i]*atom->q[j] * table;
|
|
|
|
if (factor_coul < 1.0) {
|
|
|
|
table = ctable[itable] + fraction*dctable[itable];
|
|
|
|
prefactor = atom->q[i]*atom->q[j] * table;
|
|
|
|
forcecoul -= (1.0-factor_coul)*prefactor;
|
|
|
|
}
|
|
|
|
}
|
2008-01-03 03:24:46 +08:00
|
|
|
fforce = forcecoul * r2inv;
|
2012-06-07 06:47:51 +08:00
|
|
|
|
2008-01-03 03:24:46 +08:00
|
|
|
if (!ncoultablebits || rsq <= tabinnersq)
|
|
|
|
phicoul = prefactor*erfc;
|
|
|
|
else {
|
|
|
|
table = etable[itable] + fraction*detable[itable];
|
|
|
|
phicoul = atom->q[i]*atom->q[j] * table;
|
2007-10-04 00:15:35 +08:00
|
|
|
}
|
2008-01-03 03:24:46 +08:00
|
|
|
if (factor_coul < 1.0) phicoul -= (1.0-factor_coul)*prefactor;
|
|
|
|
|
|
|
|
return phicoul;
|
2007-10-04 00:15:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ---------------------------------------------------------------------- */
|
|
|
|
|
2011-12-17 05:15:49 +08:00
|
|
|
void *PairCoulLong::extract(const char *str, int &dim)
|
2007-10-04 00:15:35 +08:00
|
|
|
{
|
2010-10-23 05:25:05 +08:00
|
|
|
if (strcmp(str,"cut_coul") == 0) {
|
|
|
|
dim = 0;
|
|
|
|
return (void *) &cut_coul;
|
|
|
|
}
|
|
|
|
if (strcmp(str,"scale") == 0) {
|
|
|
|
dim = 2;
|
|
|
|
return (void *) scale;
|
|
|
|
}
|
2007-10-05 01:57:04 +08:00
|
|
|
return NULL;
|
2007-10-04 00:15:35 +08:00
|
|
|
}
|