git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5835 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2011-03-25 21:13:51 +00:00
parent e3cf018311
commit fbb475b9cd
149 changed files with 1402 additions and 1660 deletions

View File

@ -728,9 +728,7 @@ int AtomVecEllipsoid::unpack_restart(double *buf)
if (nlocal == nmax) {
grow(0);
if (atom->nextra_store)
atom->extra = memory->grow_2d_double_array(atom->extra,nmax,
atom->nextra_store,
"atom:extra");
memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra");
}
int m = 1;

View File

@ -34,8 +34,7 @@ ComputeERotateAsphere(LAMMPS *lmp, int narg, char **arg) :
scalar_flag = 1;
extscalar = 1;
inertia =
memory->create_2d_double_array(atom->ntypes+1,3,"fix_temp_sphere:inertia");
memory->create(inertia,atom->ntypes+1,3,"fix_temp_sphere:inertia");
// error checks
@ -52,7 +51,7 @@ ComputeERotateAsphere(LAMMPS *lmp, int narg, char **arg) :
ComputeERotateAsphere::~ComputeERotateAsphere()
{
memory->destroy_2d_double_array(inertia);
memory->destroy(inertia);
}
/* ---------------------------------------------------------------------- */

View File

@ -55,8 +55,7 @@ ComputeTempAsphere::ComputeTempAsphere(LAMMPS *lmp, int narg, char **arg) :
}
vector = new double[6];
inertia =
memory->create_2d_double_array(atom->ntypes+1,3,"fix_temp_sphere:inertia");
memory->create(inertia,atom->ntypes+1,3,"fix_temp_sphere:inertia");
// error checks
@ -75,7 +74,7 @@ ComputeTempAsphere::~ComputeTempAsphere()
{
delete [] id_bias;
delete [] vector;
memory->destroy_2d_double_array(inertia);
memory->destroy(inertia);
}
/* ---------------------------------------------------------------------- */

View File

@ -33,8 +33,7 @@ using namespace LAMMPS_NS;
FixNHAsphere::FixNHAsphere(LAMMPS *lmp, int narg, char **arg) :
FixNH(lmp, narg, arg)
{
inertia =
memory->create_2d_double_array(atom->ntypes+1,3,"fix_nvt_asphere:inertia");
memory->create(inertia,atom->ntypes+1,3,"fix_nvt_asphere:inertia");
if (!atom->quat_flag || !atom->angmom_flag || !atom->torque_flag ||
!atom->avec->shape_type)
@ -49,7 +48,7 @@ FixNHAsphere::FixNHAsphere(LAMMPS *lmp, int narg, char **arg) :
FixNHAsphere::~FixNHAsphere()
{
memory->destroy_2d_double_array(inertia);
memory->destroy(inertia);
}
/* ---------------------------------------------------------------------- */

View File

@ -34,8 +34,7 @@ using namespace LAMMPS_NS;
FixNVEAsphere::FixNVEAsphere(LAMMPS *lmp, int narg, char **arg) :
FixNVE(lmp, narg, arg)
{
inertia =
memory->create_2d_double_array(atom->ntypes+1,3,"fix_nve_asphere:inertia");
memory->create(inertia,atom->ntypes+1,3,"fix_nve_asphere:inertia");
// error checks
@ -52,7 +51,7 @@ FixNVEAsphere::FixNVEAsphere(LAMMPS *lmp, int narg, char **arg) :
FixNVEAsphere::~FixNVEAsphere()
{
memory->destroy_2d_double_array(inertia);
memory->destroy(inertia);
}
/* ---------------------------------------------------------------------- */

View File

@ -52,20 +52,20 @@ PairGayBerne::PairGayBerne(LAMMPS *lmp) : Pair(lmp)
PairGayBerne::~PairGayBerne()
{
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy_2d_int_array(form);
memory->destroy_2d_double_array(epsilon);
memory->destroy_2d_double_array(sigma);
memory->destroy_2d_double_array(shape);
memory->destroy_2d_double_array(well);
memory->destroy_2d_double_array(cut);
memory->destroy_2d_double_array(lj1);
memory->destroy_2d_double_array(lj2);
memory->destroy_2d_double_array(lj3);
memory->destroy_2d_double_array(lj4);
memory->destroy_2d_double_array(offset);
memory->destroy(form);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(shape);
memory->destroy(well);
memory->destroy(cut);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(offset);
delete [] lshape;
delete [] setwell;
}
@ -227,24 +227,24 @@ void PairGayBerne::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
form = memory->create_2d_int_array(n+1,n+1,"pair:form");
epsilon = memory->create_2d_double_array(n+1,n+1,"pair:epsilon");
sigma = memory->create_2d_double_array(n+1,n+1,"pair:sigma");
shape = memory->create_2d_double_array(n+1,3,"pair:shape");
well = memory->create_2d_double_array(n+1,3,"pair:well");
cut = memory->create_2d_double_array(n+1,n+1,"pair:cut");
lj1 = memory->create_2d_double_array(n+1,n+1,"pair:lj1");
lj2 = memory->create_2d_double_array(n+1,n+1,"pair:lj2");
lj3 = memory->create_2d_double_array(n+1,n+1,"pair:lj3");
lj4 = memory->create_2d_double_array(n+1,n+1,"pair:lj4");
offset = memory->create_2d_double_array(n+1,n+1,"pair:offset");
memory->create(form,n+1,n+1,"pair:form");
memory->create(epsilon,n+1,n+1,"pair:epsilon");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(shape,n+1,3,"pair:shape");
memory->create(well,n+1,3,"pair:well");
memory->create(cut,n+1,n+1,"pair:cut");
memory->create(lj1,n+1,n+1,"pair:lj1");
memory->create(lj2,n+1,n+1,"pair:lj2");
memory->create(lj3,n+1,n+1,"pair:lj3");
memory->create(lj4,n+1,n+1,"pair:lj4");
memory->create(offset,n+1,n+1,"pair:offset");
lshape = new double[n+1];
setwell = new int[n+1];

View File

@ -58,20 +58,20 @@ PairRESquared::PairRESquared(LAMMPS *lmp) : Pair(lmp),
PairRESquared::~PairRESquared()
{
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy_2d_int_array(form);
memory->destroy_2d_double_array(epsilon);
memory->destroy_2d_double_array(sigma);
memory->destroy_2d_double_array(shape2);
memory->destroy_2d_double_array(well);
memory->destroy_2d_double_array(cut);
memory->destroy_2d_double_array(lj1);
memory->destroy_2d_double_array(lj2);
memory->destroy_2d_double_array(lj3);
memory->destroy_2d_double_array(lj4);
memory->destroy_2d_double_array(offset);
memory->destroy(form);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(shape2);
memory->destroy(well);
memory->destroy(cut);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(offset);
delete [] lshape;
delete [] setwell;
}
@ -219,24 +219,24 @@ void PairRESquared::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
form = memory->create_2d_int_array(n+1,n+1,"pair:form");
epsilon = memory->create_2d_double_array(n+1,n+1,"pair:epsilon");
sigma = memory->create_2d_double_array(n+1,n+1,"pair:sigma");
shape2 = memory->create_2d_double_array(n+1,3,"pair:shape2");
well = memory->create_2d_double_array(n+1,3,"pair:well");
cut = memory->create_2d_double_array(n+1,n+1,"pair:cut");
lj1 = memory->create_2d_double_array(n+1,n+1,"pair:lj1");
lj2 = memory->create_2d_double_array(n+1,n+1,"pair:lj2");
lj3 = memory->create_2d_double_array(n+1,n+1,"pair:lj3");
lj4 = memory->create_2d_double_array(n+1,n+1,"pair:lj4");
offset = memory->create_2d_double_array(n+1,n+1,"pair:offset");
memory->create(form,n+1,n+1,"pair:form");
memory->create(epsilon,n+1,n+1,"pair:epsilon");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(shape2,n+1,3,"pair:shape2");
memory->create(well,n+1,3,"pair:well");
memory->create(cut,n+1,n+1,"pair:cut");
memory->create(lj1,n+1,n+1,"pair:lj1");
memory->create(lj2,n+1,n+1,"pair:lj2");
memory->create(lj3,n+1,n+1,"pair:lj3");
memory->create(lj4,n+1,n+1,"pair:lj4");
memory->create(offset,n+1,n+1,"pair:offset");
lshape = new double[n+1];
setwell = new int[n+1];

View File

@ -36,17 +36,17 @@ PairLJClass2::PairLJClass2(LAMMPS *lmp) : Pair(lmp) {}
PairLJClass2::~PairLJClass2()
{
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy_2d_double_array(cut);
memory->destroy_2d_double_array(epsilon);
memory->destroy_2d_double_array(sigma);
memory->destroy_2d_double_array(lj1);
memory->destroy_2d_double_array(lj2);
memory->destroy_2d_double_array(lj3);
memory->destroy_2d_double_array(lj4);
memory->destroy_2d_double_array(offset);
memory->destroy(cut);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(offset);
}
}
@ -143,21 +143,21 @@ void PairLJClass2::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
cut = memory->create_2d_double_array(n+1,n+1,"pair:cut");
epsilon = memory->create_2d_double_array(n+1,n+1,"pair:epsilon");
sigma = memory->create_2d_double_array(n+1,n+1,"pair:sigma");
lj1 = memory->create_2d_double_array(n+1,n+1,"pair:lj1");
lj2 = memory->create_2d_double_array(n+1,n+1,"pair:lj2");
lj3 = memory->create_2d_double_array(n+1,n+1,"pair:lj3");
lj4 = memory->create_2d_double_array(n+1,n+1,"pair:lj4");
offset = memory->create_2d_double_array(n+1,n+1,"pair:offset");
memory->create(cut,n+1,n+1,"pair:cut");
memory->create(epsilon,n+1,n+1,"pair:epsilon");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(lj1,n+1,n+1,"pair:lj1");
memory->create(lj2,n+1,n+1,"pair:lj2");
memory->create(lj3,n+1,n+1,"pair:lj3");
memory->create(lj4,n+1,n+1,"pair:lj4");
memory->create(offset,n+1,n+1,"pair:offset");
}
/* ----------------------------------------------------------------------

View File

@ -37,20 +37,20 @@ PairLJClass2CoulCut::PairLJClass2CoulCut(LAMMPS *lmp) : Pair(lmp) {}
PairLJClass2CoulCut::~PairLJClass2CoulCut()
{
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy_2d_double_array(cut_lj);
memory->destroy_2d_double_array(cut_ljsq);
memory->destroy_2d_double_array(cut_coul);
memory->destroy_2d_double_array(cut_coulsq);
memory->destroy_2d_double_array(epsilon);
memory->destroy_2d_double_array(sigma);
memory->destroy_2d_double_array(lj1);
memory->destroy_2d_double_array(lj2);
memory->destroy_2d_double_array(lj3);
memory->destroy_2d_double_array(lj4);
memory->destroy_2d_double_array(offset);
memory->destroy(cut_lj);
memory->destroy(cut_ljsq);
memory->destroy(cut_coul);
memory->destroy(cut_coulsq);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(offset);
}
}
@ -166,24 +166,24 @@ void PairLJClass2CoulCut::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
cut_lj = memory->create_2d_double_array(n+1,n+1,"pair:cut_lj");
cut_ljsq = memory->create_2d_double_array(n+1,n+1,"pair:cut_ljsq");
cut_coul = memory->create_2d_double_array(n+1,n+1,"pair:cut_coul");
cut_coulsq = memory->create_2d_double_array(n+1,n+1,"pair:cut_coulsq");
epsilon = memory->create_2d_double_array(n+1,n+1,"pair:epsilon");
sigma = memory->create_2d_double_array(n+1,n+1,"pair:sigma");
lj1 = memory->create_2d_double_array(n+1,n+1,"pair:lj1");
lj2 = memory->create_2d_double_array(n+1,n+1,"pair:lj2");
lj3 = memory->create_2d_double_array(n+1,n+1,"pair:lj3");
lj4 = memory->create_2d_double_array(n+1,n+1,"pair:lj4");
offset = memory->create_2d_double_array(n+1,n+1,"pair:offset");
memory->create(cut_lj,n+1,n+1,"pair:cut_lj");
memory->create(cut_ljsq,n+1,n+1,"pair:cut_ljsq");
memory->create(cut_coul,n+1,n+1,"pair:cut_coul");
memory->create(cut_coulsq,n+1,n+1,"pair:cut_coulsq");
memory->create(epsilon,n+1,n+1,"pair:epsilon");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(lj1,n+1,n+1,"pair:lj1");
memory->create(lj2,n+1,n+1,"pair:lj2");
memory->create(lj3,n+1,n+1,"pair:lj3");
memory->create(lj4,n+1,n+1,"pair:lj4");
memory->create(offset,n+1,n+1,"pair:offset");
}
/* ----------------------------------------------------------------------

View File

@ -47,18 +47,18 @@ PairLJClass2CoulLong::PairLJClass2CoulLong(LAMMPS *lmp) : Pair(lmp) {}
PairLJClass2CoulLong::~PairLJClass2CoulLong()
{
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy_2d_double_array(cut_lj);
memory->destroy_2d_double_array(cut_ljsq);
memory->destroy_2d_double_array(epsilon);
memory->destroy_2d_double_array(sigma);
memory->destroy_2d_double_array(lj1);
memory->destroy_2d_double_array(lj2);
memory->destroy_2d_double_array(lj3);
memory->destroy_2d_double_array(lj4);
memory->destroy_2d_double_array(offset);
memory->destroy(cut_lj);
memory->destroy(cut_ljsq);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(offset);
}
}
@ -183,22 +183,22 @@ void PairLJClass2CoulLong::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
cut_lj = memory->create_2d_double_array(n+1,n+1,"pair:cut_lj");
cut_ljsq = memory->create_2d_double_array(n+1,n+1,"pair:cut_ljsq");
epsilon = memory->create_2d_double_array(n+1,n+1,"pair:epsilon");
sigma = memory->create_2d_double_array(n+1,n+1,"pair:sigma");
lj1 = memory->create_2d_double_array(n+1,n+1,"pair:lj1");
lj2 = memory->create_2d_double_array(n+1,n+1,"pair:lj2");
lj3 = memory->create_2d_double_array(n+1,n+1,"pair:lj3");
lj4 = memory->create_2d_double_array(n+1,n+1,"pair:lj4");
offset = memory->create_2d_double_array(n+1,n+1,"pair:offset");
memory->create(cut_lj,n+1,n+1,"pair:cut_lj");
memory->create(cut_ljsq,n+1,n+1,"pair:cut_ljsq");
memory->create(epsilon,n+1,n+1,"pair:epsilon");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(lj1,n+1,n+1,"pair:lj1");
memory->create(lj2,n+1,n+1,"pair:lj2");
memory->create(lj3,n+1,n+1,"pair:lj3");
memory->create(lj4,n+1,n+1,"pair:lj4");
memory->create(offset,n+1,n+1,"pair:offset");
}
/* ----------------------------------------------------------------------

View File

@ -608,9 +608,7 @@ int AtomVecColloid::unpack_restart(double *buf)
if (nlocal == nmax) {
grow(0);
if (atom->nextra_store)
atom->extra = memory->grow_2d_double_array(atom->extra,nmax,
atom->nextra_store,
"atom:extra");
memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra");
}
int m = 1;

View File

@ -43,25 +43,25 @@ PairColloid::PairColloid(LAMMPS *lmp) : Pair(lmp) {}
PairColloid::~PairColloid()
{
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy_2d_int_array(form);
memory->destroy_2d_double_array(a12);
memory->destroy_2d_double_array(sigma);
memory->destroy_2d_double_array(d1);
memory->destroy_2d_double_array(d2);
memory->destroy_2d_double_array(a1);
memory->destroy_2d_double_array(a2);
memory->destroy_2d_double_array(diameter);
memory->destroy_2d_double_array(cut);
memory->destroy_2d_double_array(offset);
memory->destroy_2d_double_array(sigma3);
memory->destroy_2d_double_array(sigma6);
memory->destroy_2d_double_array(lj1);
memory->destroy_2d_double_array(lj2);
memory->destroy_2d_double_array(lj3);
memory->destroy_2d_double_array(lj4);
memory->destroy(form);
memory->destroy(a12);
memory->destroy(sigma);
memory->destroy(d1);
memory->destroy(d2);
memory->destroy(a1);
memory->destroy(a2);
memory->destroy(diameter);
memory->destroy(cut);
memory->destroy(offset);
memory->destroy(sigma3);
memory->destroy(sigma6);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
}
}
@ -218,29 +218,29 @@ void PairColloid::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
form = memory->create_2d_int_array(n+1,n+1,"pair:form");
a12 = memory->create_2d_double_array(n+1,n+1,"pair:a12");
sigma = memory->create_2d_double_array(n+1,n+1,"pair:sigma");
d1 = memory->create_2d_double_array(n+1,n+1,"pair:d1");
d2 = memory->create_2d_double_array(n+1,n+1,"pair:d2");
a1 = memory->create_2d_double_array(n+1,n+1,"pair:a1");
a2 = memory->create_2d_double_array(n+1,n+1,"pair:a2");
diameter = memory->create_2d_double_array(n+1,n+1,"pair:diameter");
cut = memory->create_2d_double_array(n+1,n+1,"pair:cut");
offset = memory->create_2d_double_array(n+1,n+1,"pair:offset");
sigma3 = memory->create_2d_double_array(n+1,n+1,"pair:sigma3");
sigma6 = memory->create_2d_double_array(n+1,n+1,"pair:sigma6");
lj1 = memory->create_2d_double_array(n+1,n+1,"pair:lj1");
lj2 = memory->create_2d_double_array(n+1,n+1,"pair:lj2");
lj3 = memory->create_2d_double_array(n+1,n+1,"pair:lj3");
lj4 = memory->create_2d_double_array(n+1,n+1,"pair:lj4");
memory->create(form,n+1,n+1,"pair:form");
memory->create(a12,n+1,n+1,"pair:a12");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(d1,n+1,n+1,"pair:d1");
memory->create(d2,n+1,n+1,"pair:d2");
memory->create(a1,n+1,n+1,"pair:a1");
memory->create(a2,n+1,n+1,"pair:a2");
memory->create(diameter,n+1,n+1,"pair:diameter");
memory->create(cut,n+1,n+1,"pair:cut");
memory->create(offset,n+1,n+1,"pair:offset");
memory->create(sigma3,n+1,n+1,"pair:sigma3");
memory->create(sigma6,n+1,n+1,"pair:sigma6");
memory->create(lj1,n+1,n+1,"pair:lj1");
memory->create(lj2,n+1,n+1,"pair:lj2");
memory->create(lj3,n+1,n+1,"pair:lj3");
memory->create(lj4,n+1,n+1,"pair:lj4");
}
/* ----------------------------------------------------------------------

View File

@ -51,11 +51,11 @@ PairLubricate::PairLubricate(LAMMPS *lmp) : Pair(lmp)
PairLubricate::~PairLubricate()
{
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy_2d_double_array(cut);
memory->destroy_2d_double_array(cut_inner);
memory->destroy(cut);
memory->destroy(cut_inner);
}
delete random;
@ -302,15 +302,15 @@ void PairLubricate::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
cut = memory->create_2d_double_array(n+1,n+1,"pair:cut");
cut_inner = memory->create_2d_double_array(n+1,n+1,"pair:cut_inner");
memory->create(cut,n+1,n+1,"pair:cut");
memory->create(cut_inner,n+1,n+1,"pair:cut_inner");
}
/* ----------------------------------------------------------------------

View File

@ -716,9 +716,7 @@ int AtomVecDipole::unpack_restart(double *buf)
if (nlocal == nmax) {
grow(0);
if (atom->nextra_store)
atom->extra = memory->grow_2d_double_array(atom->extra,nmax,
atom->nextra_store,
"atom:extra");
memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra");
}
int m = 1;

View File

@ -39,20 +39,20 @@ PairDipoleCut::PairDipoleCut(LAMMPS *lmp) : Pair(lmp)
PairDipoleCut::~PairDipoleCut()
{
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy_2d_double_array(cut_lj);
memory->destroy_2d_double_array(cut_ljsq);
memory->destroy_2d_double_array(cut_coul);
memory->destroy_2d_double_array(cut_coulsq);
memory->destroy_2d_double_array(epsilon);
memory->destroy_2d_double_array(sigma);
memory->destroy_2d_double_array(lj1);
memory->destroy_2d_double_array(lj2);
memory->destroy_2d_double_array(lj3);
memory->destroy_2d_double_array(lj4);
memory->destroy_2d_double_array(offset);
memory->destroy(cut_lj);
memory->destroy(cut_ljsq);
memory->destroy(cut_coul);
memory->destroy(cut_coulsq);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(offset);
}
}
@ -273,24 +273,24 @@ void PairDipoleCut::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
cut_lj = memory->create_2d_double_array(n+1,n+1,"pair:cut_lj");
cut_ljsq = memory->create_2d_double_array(n+1,n+1,"pair:cut_ljsq");
cut_coul = memory->create_2d_double_array(n+1,n+1,"pair:cut_coul");
cut_coulsq = memory->create_2d_double_array(n+1,n+1,"pair:cut_coulsq");
epsilon = memory->create_2d_double_array(n+1,n+1,"pair:epsilon");
sigma = memory->create_2d_double_array(n+1,n+1,"pair:sigma");
lj1 = memory->create_2d_double_array(n+1,n+1,"pair:lj1");
lj2 = memory->create_2d_double_array(n+1,n+1,"pair:lj2");
lj3 = memory->create_2d_double_array(n+1,n+1,"pair:lj3");
lj4 = memory->create_2d_double_array(n+1,n+1,"pair:lj4");
offset = memory->create_2d_double_array(n+1,n+1,"pair:offset");
memory->create(cut_lj,n+1,n+1,"pair:cut_lj");
memory->create(cut_ljsq,n+1,n+1,"pair:cut_ljsq");
memory->create(cut_coul,n+1,n+1,"pair:cut_coul");
memory->create(cut_coulsq,n+1,n+1,"pair:cut_coulsq");
memory->create(epsilon,n+1,n+1,"pair:epsilon");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(lj1,n+1,n+1,"pair:lj1");
memory->create(lj2,n+1,n+1,"pair:lj2");
memory->create(lj3,n+1,n+1,"pair:lj3");
memory->create(lj4,n+1,n+1,"pair:lj4");
memory->create(offset,n+1,n+1,"pair:offset");
}
/* ----------------------------------------------------------------------

View File

@ -52,14 +52,14 @@ PairDSMC::PairDSMC(LAMMPS *lmp) : Pair(lmp)
PairDSMC::~PairDSMC()
{
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy_2d_double_array(sigma);
memory->destroy_2d_double_array(cut);
memory->destroy_2d_double_array(V_sigma_max);
memory->destroy_2d_int_array(particle_list);
memory->destroy_2d_int_array(first);
memory->destroy_2d_int_array(number);
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(sigma);
memory->destroy(cut);
memory->destroy(V_sigma_max);
memory->destroy(particle_list);
memory->destroy(first);
memory->destroy(number);
}
delete [] next_particle;
@ -113,9 +113,8 @@ void PairDSMC::compute(int eflag, int vflag)
number_of_A = number[itype][icell];
if (number_of_A > max_particle_list) {
max_particle_list = number_of_A;
particle_list = memory->grow_2d_int_array(particle_list,atom->ntypes+1,
max_particle_list,
"pair:particle_list");
memory->grow(particle_list,atom->ntypes+1,max_particle_list,
"pair:particle_list");
}
int m = first[itype][icell];
@ -191,16 +190,16 @@ void PairDSMC::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
cut = memory->create_2d_double_array(n+1,n+1,"pair:cut");
sigma = memory->create_2d_double_array(n+1,n+1,"pair:sigma");
V_sigma_max = memory->create_2d_double_array(n+1,n+1,"pair:V_sigma_max");
memory->create(cut,n+1,n+1,"pair:cut");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(V_sigma_max,n+1,n+1,"pair:V_sigma_max");
}
/* ----------------------------------------------------------------------
@ -297,12 +296,9 @@ void PairDSMC::init_style()
total_ncells = ncellsx*ncellsy*ncellsz;
vol = cellx*celly*cellz;
particle_list = memory->create_2d_int_array(atom->ntypes+1,0,
"pair:particle_list");
first = memory->create_2d_int_array(atom->ntypes+1,total_ncells,
"pair:first");
number = memory->create_2d_int_array(atom->ntypes+1,total_ncells,
"pair:number");
memory->create(particle_list,atom->ntypes+1,0,"pair:particle_list");
memory->create(first,atom->ntypes+1,total_ncells,"pair:first");
memory->create(number,atom->ntypes+1,total_ncells,"pair:number");
for (int i = 1; i <= atom->ntypes; i++)
for (int j = 1; j <= atom->ntypes; j++)

View File

@ -837,9 +837,7 @@ int AtomVecGranular::unpack_restart(double *buf)
if (nlocal == nmax) {
grow(0);
if (atom->nextra_store)
atom->extra = memory->grow_2d_double_array(atom->extra,nmax,
atom->nextra_store,
"atom:extra");
memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra");
}
int m = 1;

View File

@ -331,10 +331,9 @@ void FixPour::pre_exchange()
// xmine is for my atoms
// xnear is for atoms from all procs + atoms to be inserted
double **xmine =
memory->create_2d_double_array(ncount,4,"fix_pour:xmine");
double **xnear =
memory->create_2d_double_array(nprevious+nnew,4,"fix_pour:xnear");
double **xmine,**xnear;
memory->create(xmine,ncount,4,"fix_pour:xmine");
memory->create(xnear,nprevious+nnew,4,"fix_pour:xnear");
int nnear = nprevious;
// setup for allgatherv
@ -503,8 +502,8 @@ void FixPour::pre_exchange()
// free local memory
memory->destroy_2d_double_array(xmine);
memory->destroy_2d_double_array(xnear);
memory->destroy(xmine);
memory->destroy(xnear);
// next timestep to insert

View File

@ -195,7 +195,7 @@ FixWallGran::~FixWallGran()
// delete locally stored arrays
memory->destroy_2d_double_array(shear);
memory->destroy(shear);
}
/* ---------------------------------------------------------------------- */
@ -678,7 +678,7 @@ double FixWallGran::memory_usage()
void FixWallGran::grow_arrays(int nmax)
{
shear = memory->grow_2d_double_array(shear,nmax,3,"fix_wall_gran:shear");
memory->grow(shear,nmax,3,"fix_wall_gran:shear");
}
/* ----------------------------------------------------------------------

View File

@ -58,8 +58,8 @@ PairGranHookeHistory::~PairGranHookeHistory()
if (fix_history) modify->delete_fix("SHEAR_HISTORY");
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
delete [] onerad_dynamic;
delete [] onerad_frozen;
@ -279,12 +279,12 @@ void PairGranHookeHistory::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
onerad_dynamic = new double[n+1];
onerad_frozen = new double[n+1];

View File

@ -65,7 +65,7 @@ Ewald::Ewald(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg)
Ewald::~Ewald()
{
deallocate();
memory->destroy_2d_double_array(ek);
memory->destroy(ek);
memory->destroy3d_offset(cs,-kmax_created);
memory->destroy3d_offset(sn,-kmax_created);
}
@ -191,11 +191,11 @@ void Ewald::setup()
deallocate();
allocate();
memory->destroy_2d_double_array(ek);
memory->destroy(ek);
memory->destroy3d_offset(cs,-kmax_created);
memory->destroy3d_offset(sn,-kmax_created);
nmax = atom->nmax;
ek = memory->create_2d_double_array(nmax,3,"ewald:ek");
memory->create(ek,nmax,3,"ewald:ek");
memory->create3d_offset(cs,-kmax,kmax,3,nmax,"ewald:cs");
memory->create3d_offset(sn,-kmax,kmax,3,nmax,"ewald:sn");
kmax_created = kmax;
@ -220,11 +220,11 @@ void Ewald::compute(int eflag, int vflag)
// extend size of per-atom arrays if necessary
if (atom->nlocal > nmax) {
memory->destroy_2d_double_array(ek);
memory->destroy(ek);
memory->destroy3d_offset(cs,-kmax_created);
memory->destroy3d_offset(sn,-kmax_created);
nmax = atom->nmax;
ek = memory->create_2d_double_array(nmax,3,"ewald:ek");
memory->create(ek,nmax,3,"ewald:ek");
memory->create3d_offset(cs,-kmax,kmax,3,nmax,"ewald:cs");
memory->create3d_offset(sn,-kmax,kmax,3,nmax,"ewald:sn");
kmax_created = kmax;
@ -766,8 +766,8 @@ void Ewald::allocate()
kzvecs = new int[kmax3d];
ug = new double[kmax3d];
eg = memory->create_2d_double_array(kmax3d,3,"ewald:eg");
vg = memory->create_2d_double_array(kmax3d,6,"ewald:vg");
memory->create(eg,kmax3d,3,"ewald:eg");
memory->create(vg,kmax3d,6,"ewald:vg");
sfacrl = new double[kmax3d];
sfacim = new double[kmax3d];
@ -786,8 +786,8 @@ void Ewald::deallocate()
delete [] kzvecs;
delete [] ug;
memory->destroy_2d_double_array(eg);
memory->destroy_2d_double_array(vg);
memory->destroy(eg);
memory->destroy(vg);
delete [] sfacrl;
delete [] sfacim;

View File

@ -51,21 +51,21 @@ PairBornCoulLong::PairBornCoulLong(LAMMPS *lmp) : Pair(lmp) {}
PairBornCoulLong::~PairBornCoulLong()
{
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy_2d_double_array(cut_lj);
memory->destroy_2d_double_array(cut_ljsq);
memory->destroy_2d_double_array(a);
memory->destroy_2d_double_array(rho);
memory->destroy_2d_double_array(sigma);
memory->destroy_2d_double_array(c);
memory->destroy_2d_double_array(d);
memory->destroy_2d_double_array(rhoinv);
memory->destroy_2d_double_array(born1);
memory->destroy_2d_double_array(born2);
memory->destroy_2d_double_array(born3);
memory->destroy_2d_double_array(offset);
memory->destroy(cut_lj);
memory->destroy(cut_ljsq);
memory->destroy(a);
memory->destroy(rho);
memory->destroy(sigma);
memory->destroy(c);
memory->destroy(d);
memory->destroy(rhoinv);
memory->destroy(born1);
memory->destroy(born2);
memory->destroy(born3);
memory->destroy(offset);
}
}
@ -191,25 +191,25 @@ void PairBornCoulLong::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
cut_lj = memory->create_2d_double_array(n+1,n+1,"pair:cut_lj");
cut_ljsq = memory->create_2d_double_array(n+1,n+1,"pair:cut_ljsq");
a = memory->create_2d_double_array(n+1,n+1,"pair:a");
rho = memory->create_2d_double_array(n+1,n+1,"pair:rho");
sigma = memory->create_2d_double_array(n+1,n+1,"pair:sigma");
c = memory->create_2d_double_array(n+1,n+1,"pair:c");
d = memory->create_2d_double_array(n+1,n+1,"pair:d");
rhoinv = memory->create_2d_double_array(n+1,n+1,"pair:rhoinv");
born1 = memory->create_2d_double_array(n+1,n+1,"pair:born1");
born2 = memory->create_2d_double_array(n+1,n+1,"pair:born2");
born3 = memory->create_2d_double_array(n+1,n+1,"pair:born3");
offset = memory->create_2d_double_array(n+1,n+1,"pair:offset");
memory->create(cut_lj,n+1,n+1,"pair:cut_lj");
memory->create(cut_ljsq,n+1,n+1,"pair:cut_ljsq");
memory->create(a,n+1,n+1,"pair:a");
memory->create(rho,n+1,n+1,"pair:rho");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(c,n+1,n+1,"pair:c");
memory->create(d,n+1,n+1,"pair:d");
memory->create(rhoinv,n+1,n+1,"pair:rhoinv");
memory->create(born1,n+1,n+1,"pair:born1");
memory->create(born2,n+1,n+1,"pair:born2");
memory->create(born3,n+1,n+1,"pair:born3");
memory->create(offset,n+1,n+1,"pair:offset");
}
/* ----------------------------------------------------------------------

View File

@ -47,18 +47,18 @@ PairBuckCoulLong::PairBuckCoulLong(LAMMPS *lmp) : Pair(lmp) {}
PairBuckCoulLong::~PairBuckCoulLong()
{
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy_2d_double_array(cut_lj);
memory->destroy_2d_double_array(cut_ljsq);
memory->destroy_2d_double_array(a);
memory->destroy_2d_double_array(rho);
memory->destroy_2d_double_array(c);
memory->destroy_2d_double_array(rhoinv);
memory->destroy_2d_double_array(buck1);
memory->destroy_2d_double_array(buck2);
memory->destroy_2d_double_array(offset);
memory->destroy(cut_lj);
memory->destroy(cut_ljsq);
memory->destroy(a);
memory->destroy(rho);
memory->destroy(c);
memory->destroy(rhoinv);
memory->destroy(buck1);
memory->destroy(buck2);
memory->destroy(offset);
}
}
@ -183,22 +183,22 @@ void PairBuckCoulLong::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
cut_lj = memory->create_2d_double_array(n+1,n+1,"pair:cut_lj");
cut_ljsq = memory->create_2d_double_array(n+1,n+1,"pair:cut_ljsq");
a = memory->create_2d_double_array(n+1,n+1,"pair:a");
rho = memory->create_2d_double_array(n+1,n+1,"pair:rho");
c = memory->create_2d_double_array(n+1,n+1,"pair:c");
rhoinv = memory->create_2d_double_array(n+1,n+1,"pair:rhoinv");
buck1 = memory->create_2d_double_array(n+1,n+1,"pair:buck1");
buck2 = memory->create_2d_double_array(n+1,n+1,"pair:buck2");
offset = memory->create_2d_double_array(n+1,n+1,"pair:offset");
memory->create(cut_lj,n+1,n+1,"pair:cut_lj");
memory->create(cut_ljsq,n+1,n+1,"pair:cut_ljsq");
memory->create(a,n+1,n+1,"pair:a");
memory->create(rho,n+1,n+1,"pair:rho");
memory->create(c,n+1,n+1,"pair:c");
memory->create(rhoinv,n+1,n+1,"pair:rhoinv");
memory->create(buck1,n+1,n+1,"pair:buck1");
memory->create(buck2,n+1,n+1,"pair:buck2");
memory->create(offset,n+1,n+1,"pair:offset");
}
/* ----------------------------------------------------------------------

View File

@ -57,10 +57,10 @@ PairCoulLong::PairCoulLong(LAMMPS *lmp) : Pair(lmp)
PairCoulLong::~PairCoulLong()
{
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy_2d_double_array(scale);
memory->destroy(scale);
}
if (ftable) free_tables();
}
@ -188,14 +188,14 @@ void PairCoulLong::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
scale = memory->create_2d_double_array(n+1,n+1,"pair:scale");
memory->create(scale,n+1,n+1,"pair:scale");
}
/* ----------------------------------------------------------------------

View File

@ -63,21 +63,21 @@ PairLJCharmmCoulLong::PairLJCharmmCoulLong(LAMMPS *lmp) : Pair(lmp)
PairLJCharmmCoulLong::~PairLJCharmmCoulLong()
{
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy_2d_double_array(epsilon);
memory->destroy_2d_double_array(sigma);
memory->destroy_2d_double_array(eps14);
memory->destroy_2d_double_array(sigma14);
memory->destroy_2d_double_array(lj1);
memory->destroy_2d_double_array(lj2);
memory->destroy_2d_double_array(lj3);
memory->destroy_2d_double_array(lj4);
memory->destroy_2d_double_array(lj14_1);
memory->destroy_2d_double_array(lj14_2);
memory->destroy_2d_double_array(lj14_3);
memory->destroy_2d_double_array(lj14_4);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(eps14);
memory->destroy(sigma14);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(lj14_1);
memory->destroy(lj14_2);
memory->destroy(lj14_3);
memory->destroy(lj14_4);
}
if (ftable) free_tables();
}
@ -647,25 +647,25 @@ void PairLJCharmmCoulLong::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
epsilon = memory->create_2d_double_array(n+1,n+1,"pair:epsilon");
sigma = memory->create_2d_double_array(n+1,n+1,"pair:sigma");
eps14 = memory->create_2d_double_array(n+1,n+1,"pair:eps14");
sigma14 = memory->create_2d_double_array(n+1,n+1,"pair:sigma14");
lj1 = memory->create_2d_double_array(n+1,n+1,"pair:lj1");
lj2 = memory->create_2d_double_array(n+1,n+1,"pair:lj2");
lj3 = memory->create_2d_double_array(n+1,n+1,"pair:lj3");
lj4 = memory->create_2d_double_array(n+1,n+1,"pair:lj4");
lj14_1 = memory->create_2d_double_array(n+1,n+1,"pair:lj14_1");
lj14_2 = memory->create_2d_double_array(n+1,n+1,"pair:lj14_2");
lj14_3 = memory->create_2d_double_array(n+1,n+1,"pair:lj14_3");
lj14_4 = memory->create_2d_double_array(n+1,n+1,"pair:lj14_4");
memory->create(epsilon,n+1,n+1,"pair:epsilon");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(eps14,n+1,n+1,"pair:eps14");
memory->create(sigma14,n+1,n+1,"pair:sigma14");
memory->create(lj1,n+1,n+1,"pair:lj1");
memory->create(lj2,n+1,n+1,"pair:lj2");
memory->create(lj3,n+1,n+1,"pair:lj3");
memory->create(lj4,n+1,n+1,"pair:lj4");
memory->create(lj14_1,n+1,n+1,"pair:lj14_1");
memory->create(lj14_2,n+1,n+1,"pair:lj14_2");
memory->create(lj14_3,n+1,n+1,"pair:lj14_3");
memory->create(lj14_4,n+1,n+1,"pair:lj14_4");
}
/* ----------------------------------------------------------------------

View File

@ -59,18 +59,18 @@ PairLJCutCoulLong::PairLJCutCoulLong(LAMMPS *lmp) : Pair(lmp)
PairLJCutCoulLong::~PairLJCutCoulLong()
{
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy_2d_double_array(cut_lj);
memory->destroy_2d_double_array(cut_ljsq);
memory->destroy_2d_double_array(epsilon);
memory->destroy_2d_double_array(sigma);
memory->destroy_2d_double_array(lj1);
memory->destroy_2d_double_array(lj2);
memory->destroy_2d_double_array(lj3);
memory->destroy_2d_double_array(lj4);
memory->destroy_2d_double_array(offset);
memory->destroy(cut_lj);
memory->destroy(cut_ljsq);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(offset);
}
if (ftable) free_tables();
}
@ -589,22 +589,22 @@ void PairLJCutCoulLong::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
cut_lj = memory->create_2d_double_array(n+1,n+1,"pair:cut_lj");
cut_ljsq = memory->create_2d_double_array(n+1,n+1,"pair:cut_ljsq");
epsilon = memory->create_2d_double_array(n+1,n+1,"pair:epsilon");
sigma = memory->create_2d_double_array(n+1,n+1,"pair:sigma");
lj1 = memory->create_2d_double_array(n+1,n+1,"pair:lj1");
lj2 = memory->create_2d_double_array(n+1,n+1,"pair:lj2");
lj3 = memory->create_2d_double_array(n+1,n+1,"pair:lj3");
lj4 = memory->create_2d_double_array(n+1,n+1,"pair:lj4");
offset = memory->create_2d_double_array(n+1,n+1,"pair:offset");
memory->create(cut_lj,n+1,n+1,"pair:cut_lj");
memory->create(cut_ljsq,n+1,n+1,"pair:cut_ljsq");
memory->create(epsilon,n+1,n+1,"pair:epsilon");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(lj1,n+1,n+1,"pair:lj1");
memory->create(lj2,n+1,n+1,"pair:lj2");
memory->create(lj3,n+1,n+1,"pair:lj3");
memory->create(lj4,n+1,n+1,"pair:lj4");
memory->create(offset,n+1,n+1,"pair:offset");
}
/* ----------------------------------------------------------------------

View File

@ -90,7 +90,7 @@ PPPM::~PPPM()
{
delete [] factors;
deallocate();
memory->destroy_2d_int_array(part2grid);
memory->destroy(part2grid);
}
/* ----------------------------------------------------------------------
@ -659,9 +659,9 @@ void PPPM::compute(int eflag, int vflag)
// extend size of per-atom arrays if necessary
if (atom->nlocal > nmax) {
memory->destroy_2d_int_array(part2grid);
memory->destroy(part2grid);
nmax = atom->nmax;
part2grid = memory->create_2d_int_array(nmax,3,"pppm:part2grid");
memory->create(part2grid,nmax,3,"pppm:part2grid");
}
energy = 0.0;
@ -745,7 +745,7 @@ void PPPM::allocate()
(double *) memory->smalloc(nfft_both*sizeof(double),"pppm:greensfn");
work1 = (double *) memory->smalloc(2*nfft_both*sizeof(double),"pppm:work1");
work2 = (double *) memory->smalloc(2*nfft_both*sizeof(double),"pppm:work2");
vg = memory->create_2d_double_array(nfft_both,6,"pppm:vg");
memory->create(vg,nfft_both,6,"pppm:vg");
memory->create1d_offset(fkx,nxlo_fft,nxhi_fft,"pppm:fkx");
memory->create1d_offset(fky,nylo_fft,nyhi_fft,"pppm:fky");
@ -757,9 +757,8 @@ void PPPM::allocate()
// summation coeffs
gf_b = new double[order];
rho1d = memory->create_2d_double_array(3,-order/2,order/2,"pppm:rho1d");
rho_coeff = memory->create_2d_double_array(order,(1-order)/2,order/2,
"pppm:rho_coeff");
memory->create2d_offset(rho1d,3,-order/2,order/2,"pppm:rho1d");
memory->create2d_offset(rho_coeff,order,(1-order)/2,order/2,"pppm:rho_coeff");
// create 2 FFTs and a Remap
// 1st FFT keeps data in FFT decompostion
@ -799,7 +798,7 @@ void PPPM::deallocate()
memory->sfree(greensfn);
memory->sfree(work1);
memory->sfree(work2);
memory->destroy_2d_double_array(vg);
memory->destroy(vg);
memory->destroy1d_offset(fkx,nxlo_fft);
memory->destroy1d_offset(fky,nylo_fft);
@ -809,8 +808,8 @@ void PPPM::deallocate()
memory->sfree(buf2);
delete [] gf_b;
memory->destroy_2d_double_array(rho1d,-order/2);
memory->destroy_2d_double_array(rho_coeff,(1-order)/2);
memory->destroy2d_offset(rho1d,-order/2);
memory->destroy2d_offset(rho_coeff,(1-order)/2);
delete fft1;
delete fft2;
@ -826,7 +825,8 @@ void PPPM::set_grid()
// see JCP 109, pg 7698 for derivation of coefficients
// higher order coefficients may be computed if needed
double **acons = memory->create_2d_double_array(8,7,"pppm:acons");
double **acons;
memory->create(acons,8,7,"pppm:acons");
acons[1][0] = 2.0 / 3.0;
acons[2][0] = 1.0 / 50.0;
@ -964,7 +964,7 @@ void PPPM::set_grid()
// free local memory
memory->destroy_2d_double_array(acons);
memory->destroy(acons);
// print info
@ -1803,7 +1803,8 @@ void PPPM::compute_rho_coeff()
int j,k,l,m;
double s;
double **a = memory->create_2d_double_array(order,-order,order,"pppm:a");
double **a;
memory->create2d_offset(a,order,-order,order,"pppm:a");
for (k = -order; k <= order; k++)
for (l = 0; l < order; l++)
@ -1829,7 +1830,7 @@ void PPPM::compute_rho_coeff()
m++;
}
memory->destroy_2d_double_array(a,-order);
memory->destroy2d_offset(a,-order);
}
/* ----------------------------------------------------------------------

View File

@ -73,15 +73,15 @@ PairAIREBO::~PairAIREBO()
memory->sfree(nH);
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy_2d_double_array(cutghost);
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(cutghost);
memory->destroy_2d_double_array(cutljsq);
memory->destroy_2d_double_array(lj1);
memory->destroy_2d_double_array(lj2);
memory->destroy_2d_double_array(lj3);
memory->destroy_2d_double_array(lj4);
memory->destroy(cutljsq);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
delete [] map;
}
}
@ -110,21 +110,21 @@ void PairAIREBO::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
cutghost = memory->create_2d_double_array(n+1,n+1,"pair:cutghost");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(cutghost,n+1,n+1,"pair:cutghost");
// only sized by C,H = 2 types
cutljsq = memory->create_2d_double_array(2,2,"pair:cutljsq");
lj1 = memory->create_2d_double_array(2,2,"pair:lj1");
lj2 = memory->create_2d_double_array(2,2,"pair:lj2");
lj3 = memory->create_2d_double_array(2,2,"pair:lj3");
lj4 = memory->create_2d_double_array(2,2,"pair:lj4");
memory->create(cutljsq,2,2,"pair:cutljsq");
memory->create(lj1,2,2,"pair:lj1");
memory->create(lj2,2,2,"pair:lj2");
memory->create(lj3,2,2,"pair:lj3");
memory->create(lj4,2,2,"pair:lj4");
map = new int[n+1];
}

View File

@ -88,17 +88,17 @@ PairComb::~PairComb()
memory->sfree(params);
memory->destroy(elem2param);
memory->destroy_2d_int_array(intype);
memory->destroy_2d_double_array(fafb);
memory->destroy_2d_double_array(dfafb);
memory->destroy_2d_double_array(ddfafb);
memory->destroy_2d_double_array(phin);
memory->destroy_2d_double_array(dphin);
memory->destroy_2d_double_array(erpaw);
memory->destroy(intype);
memory->destroy(fafb);
memory->destroy(dfafb);
memory->destroy(ddfafb);
memory->destroy(phin);
memory->destroy(dphin);
memory->destroy(erpaw);
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
delete [] map;
delete [] esm;
}
@ -401,8 +401,8 @@ void PairComb::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(setflag,n+1,n+1,"pair:setflag");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
map = new int[n+1];
esm = new double[n];
@ -1351,23 +1351,23 @@ void PairComb::sm_table()
nntypes = int((n+1)*n/2); // interaction types
ncoul = int((rc-drin)/dra)+1;
memory->destroy_2d_int_array(intype);
memory->destroy_2d_double_array(fafb);
memory->destroy_2d_double_array(dfafb);
memory->destroy_2d_double_array(ddfafb);
memory->destroy_2d_double_array(phin);
memory->destroy_2d_double_array(dphin);
memory->destroy_2d_double_array(erpaw);
memory->destroy(intype);
memory->destroy(fafb);
memory->destroy(dfafb);
memory->destroy(ddfafb);
memory->destroy(phin);
memory->destroy(dphin);
memory->destroy(erpaw);
// allocate arrays
intype = memory->create_2d_int_array(n,n,"pair:intype");
fafb = memory->create_2d_double_array(ncoul,nntypes,"pair:fafb");
dfafb = memory->create_2d_double_array(ncoul,nntypes,"pair:dfafb");
ddfafb = memory->create_2d_double_array(ncoul,nntypes,"pair:ddfafb");
phin = memory->create_2d_double_array(ncoul,nntypes,"pair:phin");
dphin = memory->create_2d_double_array(ncoul,nntypes,"pair:dphin");
erpaw = memory->create_2d_double_array(25000,2,"pair:erpaw");
memory->create(intype,n,n,"pair:intype");
memory->create(fafb,ncoul,nntypes,"pair:fafb");
memory->create(dfafb,ncoul,nntypes,"pair:dfafb");
memory->create(ddfafb,ncoul,nntypes,"pair:ddfafb");
memory->create(phin,ncoul,nntypes,"pair:phin");
memory->create(dphin,ncoul,nntypes,"pair:dphin");
memory->create(erpaw,25000,2,"pair:erpaw");
// set interaction number: 0-0=0, 1-1=1, 0-1=1-0=2

View File

@ -73,12 +73,12 @@ PairEAM::~PairEAM()
memory->sfree(fp);
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
delete [] map;
delete [] type2frho;
memory->destroy_2d_int_array(type2rhor);
memory->destroy_2d_int_array(type2z2r);
memory->destroy(type2rhor);
memory->destroy(type2z2r);
}
if (funcfl) {
@ -95,8 +95,8 @@ PairEAM::~PairEAM()
for (int i = 0; i < setfl->nelements; i++) delete [] setfl->elements[i];
delete [] setfl->elements;
delete [] setfl->mass;
memory->destroy_2d_double_array(setfl->frho);
memory->destroy_2d_double_array(setfl->rhor);
memory->destroy(setfl->frho);
memory->destroy(setfl->rhor);
memory->destroy(setfl->z2r);
delete setfl;
}
@ -105,15 +105,15 @@ PairEAM::~PairEAM()
for (int i = 0; i < fs->nelements; i++) delete [] fs->elements[i];
delete [] fs->elements;
delete [] fs->mass;
memory->destroy_2d_double_array(fs->frho);
memory->destroy(fs->frho);
memory->destroy(fs->rhor);
memory->destroy(fs->z2r);
delete fs;
}
memory->destroy_2d_double_array(frho);
memory->destroy_2d_double_array(rhor);
memory->destroy_2d_double_array(z2r);
memory->destroy(frho);
memory->destroy(rhor);
memory->destroy(z2r);
memory->destroy(frho_spline);
memory->destroy(rhor_spline);
@ -310,19 +310,19 @@ void PairEAM::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
map = new int[n+1];
for (int i = 1; i <= n; i++) map[i] = -1;
type2frho = new int[n+1];
type2rhor = memory->create_2d_int_array(n+1,n+1,"pair:type2rhor");
type2z2r = memory->create_2d_int_array(n+1,n+1,"pair:type2z2r");
memory->create(type2rhor,n+1,n+1,"pair:type2rhor");
memory->create(type2z2r,n+1,n+1,"pair:type2z2r");
}
/* ----------------------------------------------------------------------
@ -523,8 +523,8 @@ void PairEAM::file2array()
// nfrho = # of funcfl files + 1 for zero array
nfrho = nfuncfl + 1;
memory->destroy_2d_double_array(frho);
frho = (double **) memory->create_2d_double_array(nfrho,nrho+1,"pair:frho");
memory->destroy(frho);
memory->create(frho,nfrho,nrho+1,"pair:frho");
// interpolate each file's frho to a single grid and cutoff
@ -572,8 +572,8 @@ void PairEAM::file2array()
// nrhor = # of funcfl files
nrhor = nfuncfl;
memory->destroy_2d_double_array(rhor);
rhor = (double **) memory->create_2d_double_array(nrhor,nr+1,"pair:rhor");
memory->destroy(rhor);
memory->create(rhor,nrhor,nr+1,"pair:rhor");
// interpolate each file's rhor to a single grid and cutoff
@ -614,8 +614,8 @@ void PairEAM::file2array()
// nz2r = N*(N+1)/2 where N = # of funcfl files
nz2r = nfuncfl*(nfuncfl+1)/2;
memory->destroy_2d_double_array(z2r);
z2r = (double **) memory->create_2d_double_array(nz2r,nr+1,"pair:z2r");
memory->destroy(z2r);
memory->create(z2r,nz2r,nr+1,"pair:z2r");
// create a z2r array for each file against other files, only for I >= J
// interpolate zri and zrj to a single grid and cutoff

View File

@ -60,8 +60,8 @@ void PairEAMAlloy::coeff(int narg, char **arg)
for (i = 0; i < setfl->nelements; i++) delete [] setfl->elements[i];
delete [] setfl->elements;
delete [] setfl->mass;
memory->destroy_2d_double_array(setfl->frho);
memory->destroy_2d_double_array(setfl->rhor);
memory->destroy(setfl->frho);
memory->destroy(setfl->rhor);
memory->destroy(setfl->z2r);
delete setfl;
}
@ -174,12 +174,10 @@ void PairEAMAlloy::read_file(char *filename)
MPI_Bcast(&file->cut,1,MPI_DOUBLE,0,world);
file->mass = new double[file->nelements];
file->frho = memory->create_2d_double_array(file->nelements,file->nrho+1,
"pair:frho");
file->rhor = memory->create_2d_double_array(file->nelements,file->nr+1,
"pair:rhor");
memory->create(file->z2r,file->nelements,file->nelements,
file->nr+1,"pair:z2r");
memory->create(file->frho,file->nelements,file->nrho+1,"pair:frho");
memory->create(file->rhor,file->nelements,file->nr+1,"pair:rhor");
memory->create(file->z2r,file->nelements,file->nelements,file->nr+1,
"pair:z2r");
int i,j,tmp;
for (i = 0; i < file->nelements; i++) {
@ -230,8 +228,8 @@ void PairEAMAlloy::file2array()
// nfrho = # of setfl elements + 1 for zero array
nfrho = setfl->nelements + 1;
memory->destroy_2d_double_array(frho);
frho = (double **) memory->create_2d_double_array(nfrho,nrho+1,"pair:frho");
memory->destroy(frho);
memory->create(frho,nfrho,nrho+1,"pair:frho");
// copy each element's frho to global frho
@ -259,8 +257,8 @@ void PairEAMAlloy::file2array()
// nrhor = # of setfl elements
nrhor = setfl->nelements;
memory->destroy_2d_double_array(rhor);
rhor = (double **) memory->create_2d_double_array(nrhor,nr+1,"pair:rhor");
memory->destroy(rhor);
memory->create(rhor,nrhor,nr+1,"pair:rhor");
// copy each element's rhor to global rhor
@ -283,8 +281,8 @@ void PairEAMAlloy::file2array()
// nz2r = N*(N+1)/2 where N = # of setfl elements
nz2r = setfl->nelements * (setfl->nelements+1) / 2;
memory->destroy_2d_double_array(z2r);
z2r = (double **) memory->create_2d_double_array(nz2r,nr+1,"pair:z2r");
memory->destroy(z2r);
memory->create(z2r,nz2r,nr+1,"pair:z2r");
// copy each element pair z2r to global z2r, only for I >= J

View File

@ -60,7 +60,7 @@ void PairEAMFS::coeff(int narg, char **arg)
for (i = 0; i < fs->nelements; i++) delete [] fs->elements[i];
delete [] fs->elements;
delete [] fs->mass;
memory->destroy_2d_double_array(fs->frho);
memory->destroy(fs->frho);
memory->destroy(fs->rhor);
memory->destroy(fs->z2r);
delete fs;
@ -174,7 +174,7 @@ void PairEAMFS::read_file(char *filename)
MPI_Bcast(&file->cut,1,MPI_DOUBLE,0,world);
file->mass = new double[file->nelements];
file->frho = memory->create_2d_double_array(file->nelements,file->nrho+1,
memory->create(file->frho,file->nelements,file->nrho+1,
"pair:frho");
memory->create(file->rhor,file->nelements,file->nelements,
file->nr+1,"pair:rhor");
@ -233,8 +233,8 @@ void PairEAMFS::file2array()
// nfrho = # of fs elements + 1 for zero array
nfrho = fs->nelements + 1;
memory->destroy_2d_double_array(frho);
frho = (double **) memory->create_2d_double_array(nfrho,nrho+1,"pair:frho");
memory->destroy(frho);
memory->create(frho,nfrho,nrho+1,"pair:frho");
// copy each element's frho to global frho
@ -262,8 +262,8 @@ void PairEAMFS::file2array()
// nrhor = square of # of fs elements
nrhor = fs->nelements * fs->nelements;
memory->destroy_2d_double_array(rhor);
rhor = (double **) memory->create_2d_double_array(nrhor,nr+1,"pair:rhor");
memory->destroy(rhor);
memory->create(rhor,nrhor,nr+1,"pair:rhor");
// copy each element pair rhor to global rhor
@ -290,8 +290,8 @@ void PairEAMFS::file2array()
// nz2r = N*(N+1)/2 where N = # of fs elements
nz2r = fs->nelements * (fs->nelements+1) / 2;
memory->destroy_2d_double_array(z2r);
z2r = (double **) memory->create_2d_double_array(nz2r,nr+1,"pair:z2r");
memory->destroy(z2r);
memory->create(z2r,nz2r,nr+1,"pair:z2r");
// copy each element pair z2r to global z2r, only for I >= J

View File

@ -77,12 +77,12 @@ PairEIM::~PairEIM()
memory->sfree(fp);
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
delete [] map;
memory->destroy_2d_int_array(type2Fij);
memory->destroy_2d_int_array(type2Gij);
memory->destroy_2d_int_array(type2phiij);
memory->destroy(type2Fij);
memory->destroy(type2Gij);
memory->destroy(type2phiij);
}
for (int i = 0; i < nelements; i++) delete [] elements[i];
@ -92,10 +92,10 @@ PairEIM::~PairEIM()
delete [] negativity;
delete [] q0;
memory->destroy_2d_double_array(cutforcesq);
memory->destroy_2d_double_array(Fij);
memory->destroy_2d_double_array(Gij);
memory->destroy_2d_double_array(phiij);
memory->destroy(cutforcesq);
memory->destroy(Fij);
memory->destroy(Gij);
memory->destroy(phiij);
memory->destroy(Fij_spline);
memory->destroy(Gij_spline);
@ -320,19 +320,19 @@ void PairEIM::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
map = new int[n+1];
for (int i = 1; i <= n; i++) map[i] = -1;
type2Fij = memory->create_2d_int_array(n+1,n+1,"pair:type2Fij");
type2Gij = memory->create_2d_int_array(n+1,n+1,"pair:type2Gij");
type2phiij = memory->create_2d_int_array(n+1,n+1,"pair:type2phiij");
memory->create(type2Fij,n+1,n+1,"pair:type2Fij");
memory->create(type2Gij,n+1,n+1,"pair:type2Gij");
memory->create(type2phiij,n+1,n+1,"pair:type2phiij");
}
/* ----------------------------------------------------------------------
@ -542,8 +542,7 @@ void PairEIM::read_file(char *filename)
}
setfl->dr = setfl->cut/(setfl->nr-1.0);
setfl->cuts = memory->create_2d_double_array(nelements,
nelements,"pair:cuts");
memory->create(setfl->cuts,nelements,nelements,"pair:cuts");
for (int i = 0; i < nelements; i++) {
for (int j = 0; j < nelements; j++) {
if (i > j) {
@ -635,7 +634,7 @@ void PairEIM::deallocate_setfl()
delete [] setfl->zeta;
delete [] setfl->rs;
delete [] setfl->tp;
memory->destroy_2d_double_array(setfl->cuts);
memory->destroy(setfl->cuts);
memory->destroy(setfl->Fij);
memory->destroy(setfl->Gij);
memory->destroy(setfl->phiij);
@ -658,8 +657,7 @@ void PairEIM::file2array()
delete [] cutforcesq;
negativity = new double[ntypes+1];
q0 = new double[ntypes+1];
cutforcesq = memory->create_2d_double_array(ntypes+1,ntypes+1,
"pair:cutforcesq");
memory->create(cutforcesq,ntypes+1,ntypes+1,"pair:cutforcesq");
for (i = 1; i <= ntypes; i++) {
if (map[i] == -1) {
negativity[i]=0.0;
@ -689,8 +687,8 @@ void PairEIM::file2array()
// ------------------------------------------------------------------
nFij = nelements*nelements + 1;
memory->destroy_2d_double_array(Fij);
Fij = (double **) memory->create_2d_double_array(nFij,nr+1,"pair:Fij");
memory->destroy(Fij);
memory->create(Fij,nFij,nr+1,"pair:Fij");
// copy each element's Fij to global Fij
@ -731,8 +729,8 @@ void PairEIM::file2array()
// ------------------------------------------------------------------
nGij = nelements * (nelements+1) / 2 + 1;
memory->destroy_2d_double_array(Gij);
Gij = (double **) memory->create_2d_double_array(nGij,nr+1,"pair:Gij");
memory->destroy(Gij);
memory->create(Gij,nGij,nr+1,"pair:Gij");
// copy each element's Gij to global Gij, only for I >= J
@ -778,8 +776,8 @@ void PairEIM::file2array()
// ------------------------------------------------------------------
nphiij = nelements * (nelements+1) / 2 + 1;
memory->destroy_2d_double_array(phiij);
phiij = (double **) memory->create_2d_double_array(nphiij,nr+1,"pair:phiij");
memory->destroy(phiij);
memory->create(phiij,nphiij,nr+1,"pair:phiij");
// copy each element pair phiij to global phiij, only for I >= J

View File

@ -63,8 +63,8 @@ PairSW::~PairSW()
memory->destroy(elem2param);
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
delete [] map;
}
}
@ -200,8 +200,8 @@ void PairSW::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(setflag,n+1,n+1,"pair:setflag");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
map = new int[n+1];
}

View File

@ -65,8 +65,8 @@ PairTersoff::~PairTersoff()
memory->destroy(elem2param);
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
delete [] map;
}
}
@ -240,8 +240,8 @@ void PairTersoff::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(setflag,n+1,n+1,"pair:setflag");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
map = new int[n+1];
}

View File

@ -90,12 +90,12 @@ PairMEAM::~PairMEAM()
memory->sfree(dgamma3);
memory->sfree(arho2b);
memory->destroy_2d_double_array(arho1);
memory->destroy_2d_double_array(arho2);
memory->destroy_2d_double_array(arho3);
memory->destroy_2d_double_array(arho3b);
memory->destroy_2d_double_array(t_ave);
memory->destroy_2d_double_array(tsq_ave);
memory->destroy(arho1);
memory->destroy(arho2);
memory->destroy(arho3);
memory->destroy(arho3b);
memory->destroy(t_ave);
memory->destroy(tsq_ave);
memory->sfree(scrfcn);
memory->sfree(dscrfcn);
@ -106,8 +106,8 @@ PairMEAM::~PairMEAM()
delete [] mass;
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
delete [] map;
delete [] fmap;
}
@ -143,12 +143,12 @@ void PairMEAM::compute(int eflag, int vflag)
memory->sfree(dgamma2);
memory->sfree(dgamma3);
memory->sfree(arho2b);
memory->destroy_2d_double_array(arho1);
memory->destroy_2d_double_array(arho2);
memory->destroy_2d_double_array(arho3);
memory->destroy_2d_double_array(arho3b);
memory->destroy_2d_double_array(t_ave);
memory->destroy_2d_double_array(tsq_ave);
memory->destroy(arho1);
memory->destroy(arho2);
memory->destroy(arho3);
memory->destroy(arho3b);
memory->destroy(t_ave);
memory->destroy(tsq_ave);
nmax = atom->nmax;
@ -163,12 +163,12 @@ void PairMEAM::compute(int eflag, int vflag)
dgamma2 = (double *) memory->smalloc(nmax*sizeof(double),"pair:dgamma2");
dgamma3 = (double *) memory->smalloc(nmax*sizeof(double),"pair:dgamma3");
arho2b = (double *) memory->smalloc(nmax*sizeof(double),"pair:arho2b");
arho1 = memory->create_2d_double_array(nmax,3,"pair:arho1");
arho2 = memory->create_2d_double_array(nmax,6,"pair:arho2");
arho3 = memory->create_2d_double_array(nmax,10,"pair:arho3");
arho3b = memory->create_2d_double_array(nmax,3,"pair:arho3b");
t_ave = memory->create_2d_double_array(nmax,3,"pair:t_ave");
tsq_ave = memory->create_2d_double_array(nmax,3,"pair:tsq_ave");
memory->create(arho1,nmax,3,"pair:arho1");
memory->create(arho2,nmax,6,"pair:arho2");
memory->create(arho3,nmax,10,"pair:arho3");
memory->create(arho3b,nmax,3,"pair:arho3b");
memory->create(t_ave,nmax,3,"pair:t_ave");
memory->create(tsq_ave,nmax,3,"pair:tsq_ave");
}
// neighbor list info
@ -307,8 +307,8 @@ void PairMEAM::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(setflag,n+1,n+1,"pair:setflag");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
map = new int[n+1];
fmap = new int[n];

View File

@ -51,7 +51,7 @@ AngleHybrid::~AngleHybrid()
delete [] nanglelist;
delete [] maxangle;
for (int i = 0; i < nstyles; i++)
memory->destroy_2d_int_array(anglelist[i]);
memory->destroy(anglelist[i]);
delete [] anglelist;
}
}
@ -80,10 +80,9 @@ void AngleHybrid::compute(int eflag, int vflag)
}
for (m = 0; m < nstyles; m++) {
if (nanglelist[m] > maxangle[m]) {
memory->destroy_2d_int_array(anglelist[m]);
memory->destroy(anglelist[m]);
maxangle[m] = nanglelist[m] + EXTRA;
anglelist[m] = (int **)
memory->create_2d_int_array(maxangle[m],4,"angle_hybrid:anglelist");
memory->create(anglelist[m],maxangle[m],4,"angle_hybrid:anglelist");
}
nanglelist[m] = 0;
}
@ -180,7 +179,7 @@ void AngleHybrid::settings(int narg, char **arg)
delete [] nanglelist;
delete [] maxangle;
for (int i = 0; i < nstyles; i++)
memory->destroy_2d_int_array(anglelist[i]);
memory->destroy(anglelist[i]);
delete [] anglelist;
}
allocated = 0;

View File

@ -667,9 +667,7 @@ int AtomVecAngle::unpack_restart(double *buf)
if (nlocal == nmax) {
grow(0);
if (atom->nextra_store)
atom->extra = memory->grow_2d_double_array(atom->extra,nmax,
atom->nextra_store,
"atom:extra");
memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra");
}
int m = 1;

View File

@ -636,9 +636,7 @@ int AtomVecBond::unpack_restart(double *buf)
if (nlocal == nmax) {
grow(0);
if (atom->nextra_store)
atom->extra = memory->grow_2d_double_array(atom->extra,nmax,
atom->nextra_store,
"atom:extra");
memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra");
}
int m = 1;

View File

@ -807,9 +807,7 @@ int AtomVecFull::unpack_restart(double *buf)
if (nlocal == nmax) {
grow(0);
if (atom->nextra_store)
atom->extra = memory->grow_2d_double_array(atom->extra,nmax,
atom->nextra_store,
"atom:extra");
memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra");
}
int m = 1;

View File

@ -793,9 +793,7 @@ int AtomVecMolecular::unpack_restart(double *buf)
if (nlocal == nmax) {
grow(0);
if (atom->nextra_store)
atom->extra = memory->grow_2d_double_array(atom->extra,nmax,
atom->nextra_store,
"atom:extra");
memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra");
}
int m = 1;

View File

@ -50,7 +50,7 @@ DihedralHybrid::~DihedralHybrid()
delete [] ndihedrallist;
delete [] maxdihedral;
for (int i = 0; i < nstyles; i++)
memory->destroy_2d_int_array(dihedrallist[i]);
memory->destroy(dihedrallist[i]);
delete [] dihedrallist;
}
}
@ -79,11 +79,10 @@ void DihedralHybrid::compute(int eflag, int vflag)
}
for (m = 0; m < nstyles; m++) {
if (ndihedrallist[m] > maxdihedral[m]) {
memory->destroy_2d_int_array(dihedrallist[m]);
memory->destroy(dihedrallist[m]);
maxdihedral[m] = ndihedrallist[m] + EXTRA;
dihedrallist[m] = (int **)
memory->create_2d_int_array(maxdihedral[m],5,
"dihedral_hybrid:dihedrallist");
memory->create(dihedrallist[m],maxdihedral[m],5,
"dihedral_hybrid:dihedrallist");
}
ndihedrallist[m] = 0;
}

View File

@ -50,7 +50,7 @@ ImproperHybrid::~ImproperHybrid()
delete [] nimproperlist;
delete [] maximproper;
for (int i = 0; i < nstyles; i++)
memory->destroy_2d_int_array(improperlist[i]);
memory->destroy(improperlist[i]);
delete [] improperlist;
}
}
@ -79,11 +79,10 @@ void ImproperHybrid::compute(int eflag, int vflag)
}
for (m = 0; m < nstyles; m++) {
if (nimproperlist[m] > maximproper[m]) {
memory->destroy_2d_int_array(improperlist[m]);
memory->destroy(improperlist[m]);
maximproper[m] = nimproperlist[m] + EXTRA;
improperlist[m] = (int **)
memory->create_2d_int_array(maximproper[m],5,
"improper_hybrid:improperlist");
memory->create(improperlist[m],maximproper[m],5,
"improper_hybrid:improperlist");
}
nimproperlist[m] = 0;
}

View File

@ -66,8 +66,8 @@ PairHbondDreidingLJ::~PairHbondDreidingLJ()
delete [] pvector;
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
delete [] donor;
delete [] acceptor;
@ -244,12 +244,12 @@ void PairHbondDreidingLJ::allocate()
// mark all setflag as set, since don't require pair_coeff of all I,J
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 1;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
donor = new int[n+1];
acceptor = new int[n+1];

View File

@ -48,21 +48,21 @@ PairLJCharmmCoulCharmm::PairLJCharmmCoulCharmm(LAMMPS *lmp) : Pair(lmp)
PairLJCharmmCoulCharmm::~PairLJCharmmCoulCharmm()
{
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy_2d_double_array(epsilon);
memory->destroy_2d_double_array(sigma);
memory->destroy_2d_double_array(eps14);
memory->destroy_2d_double_array(sigma14);
memory->destroy_2d_double_array(lj1);
memory->destroy_2d_double_array(lj2);
memory->destroy_2d_double_array(lj3);
memory->destroy_2d_double_array(lj4);
memory->destroy_2d_double_array(lj14_1);
memory->destroy_2d_double_array(lj14_2);
memory->destroy_2d_double_array(lj14_3);
memory->destroy_2d_double_array(lj14_4);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(eps14);
memory->destroy(sigma14);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(lj14_1);
memory->destroy(lj14_2);
memory->destroy(lj14_3);
memory->destroy(lj14_4);
}
}
@ -202,25 +202,25 @@ void PairLJCharmmCoulCharmm::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
epsilon = memory->create_2d_double_array(n+1,n+1,"pair:epsilon");
sigma = memory->create_2d_double_array(n+1,n+1,"pair:sigma");
eps14 = memory->create_2d_double_array(n+1,n+1,"pair:eps14");
sigma14 = memory->create_2d_double_array(n+1,n+1,"pair:sigma14");
lj1 = memory->create_2d_double_array(n+1,n+1,"pair:lj1");
lj2 = memory->create_2d_double_array(n+1,n+1,"pair:lj2");
lj3 = memory->create_2d_double_array(n+1,n+1,"pair:lj3");
lj4 = memory->create_2d_double_array(n+1,n+1,"pair:lj4");
lj14_1 = memory->create_2d_double_array(n+1,n+1,"pair:lj14_1");
lj14_2 = memory->create_2d_double_array(n+1,n+1,"pair:lj14_2");
lj14_3 = memory->create_2d_double_array(n+1,n+1,"pair:lj14_3");
lj14_4 = memory->create_2d_double_array(n+1,n+1,"pair:lj14_4");
memory->create(epsilon,n+1,n+1,"pair:epsilon");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(eps14,n+1,n+1,"pair:eps14");
memory->create(sigma14,n+1,n+1,"pair:sigma14");
memory->create(lj1,n+1,n+1,"pair:lj1");
memory->create(lj2,n+1,n+1,"pair:lj2");
memory->create(lj3,n+1,n+1,"pair:lj3");
memory->create(lj4,n+1,n+1,"pair:lj4");
memory->create(lj14_1,n+1,n+1,"pair:lj14_1");
memory->create(lj14_2,n+1,n+1,"pair:lj14_2");
memory->create(lj14_3,n+1,n+1,"pair:lj14_3");
memory->create(lj14_4,n+1,n+1,"pair:lj14_4");
}
/* ----------------------------------------------------------------------

View File

@ -664,9 +664,7 @@ int AtomVecPeri::unpack_restart(double *buf)
if (nlocal == nmax) {
grow(0);
if (atom->nextra_store)
atom->extra = memory->grow_2d_double_array(atom->extra,nmax,
atom->nextra_store,
"atom:extra");
memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra");
}
int m = 1;

View File

@ -83,8 +83,8 @@ FixPeriNeigh::~FixPeriNeigh()
// delete locally stored arrays
memory->sfree(npartner);
memory->destroy_2d_int_array(partner);
memory->destroy_2d_double_array(r0);
memory->destroy(partner);
memory->destroy(r0);
memory->sfree(vinter);
memory->sfree(wvolume);
}
@ -195,8 +195,8 @@ void FixPeriNeigh::setup(int vflag)
// realloc arrays with correct value for maxpartner
memory->destroy_2d_int_array(partner);
memory->destroy_2d_double_array(r0);
memory->destroy(partner);
memory->destroy(r0);
memory->sfree(npartner);
npartner = NULL;
@ -356,9 +356,8 @@ void FixPeriNeigh::grow_arrays(int nmax)
{
npartner = (int *) memory->srealloc(npartner,nmax*sizeof(int),
"peri_neigh:npartner");
partner = memory->grow_2d_int_array(partner,nmax,maxpartner,
"peri_neigh:partner");
r0 = memory->grow_2d_double_array(r0,nmax,maxpartner,"peri_neigh:r0");
memory->grow(partner,nmax,maxpartner,"peri_neigh:partner");
memory->grow(r0,nmax,maxpartner,"peri_neigh:r0");
vinter = (double *) memory->srealloc(vinter,nmax*sizeof(double),
"peri_neigh:vinter");
wvolume = (double *) memory->srealloc(wvolume,nmax*sizeof(double),

View File

@ -70,13 +70,13 @@ PairPeriLPS::~PairPeriLPS()
if (ifix_peri >= 0) modify->delete_fix("PERI_NEIGH");
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy_2d_double_array(bulkmodulus);
memory->destroy_2d_double_array(shearmodulus);
memory->destroy_2d_double_array(s00);
memory->destroy_2d_double_array(alpha);
memory->destroy_2d_double_array(cut);
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(bulkmodulus);
memory->destroy(shearmodulus);
memory->destroy(s00);
memory->destroy(alpha);
memory->destroy(cut);
memory->sfree(theta);
memory->sfree(s0_new);
}
@ -343,18 +343,17 @@ void PairPeriLPS::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
bulkmodulus = memory->create_2d_double_array(n+1,n+1,"pair:bulkmodulus");
shearmodulus = memory->create_2d_double_array(n+1,n+1,"pair:shearmodulus");
s00 = memory->create_2d_double_array(n+1,n+1,"pair:s00");
alpha = memory->create_2d_double_array(n+1,n+1,"pair:alpha");
cut = memory->create_2d_double_array(n+1,n+1,"pair:cut");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(bulkmodulus,n+1,n+1,"pair:bulkmodulus");
memory->create(shearmodulus,n+1,n+1,"pair:shearmodulus");
memory->create(s00,n+1,n+1,"pair:s00");
memory->create(alpha,n+1,n+1,"pair:alpha");
memory->create(cut,n+1,n+1,"pair:cut");
}
/* ----------------------------------------------------------------------

View File

@ -65,12 +65,12 @@ PairPeriPMB::~PairPeriPMB()
if (ifix_peri >= 0) modify->delete_fix("PERI_NEIGH");
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy_2d_double_array(kspring);
memory->destroy_2d_double_array(s00);
memory->destroy_2d_double_array(alpha);
memory->destroy_2d_double_array(cut);
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(kspring);
memory->destroy(s00);
memory->destroy(alpha);
memory->destroy(cut);
memory->sfree(s0_new);
}
}
@ -284,16 +284,16 @@ void PairPeriPMB::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
kspring = memory->create_2d_double_array(n+1,n+1,"pair:kspring");
s00 = memory->create_2d_double_array(n+1,n+1,"pair:s00");
alpha = memory->create_2d_double_array(n+1,n+1,"pair:alpha");
cut = memory->create_2d_double_array(n+1,n+1,"pair:cut");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(kspring,n+1,n+1,"pair:kspring");
memory->create(s00,n+1,n+1,"pair:s00");
memory->create(alpha,n+1,n+1,"pair:alpha");
memory->create(cut,n+1,n+1,"pair:cut");
}
/* ----------------------------------------------------------------------

View File

@ -197,19 +197,19 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) :
nrigid = new int[nbody];
masstotal = new double[nbody];
xcm = memory->create_2d_double_array(nbody,3,"poems:xcm");
vcm = memory->create_2d_double_array(nbody,3,"poems:vcm");
fcm = memory->create_2d_double_array(nbody,3,"poems:fcm");
inertia = memory->create_2d_double_array(nbody,3,"poems:inertia");
ex_space = memory->create_2d_double_array(nbody,3,"poems:ex_space");
ey_space = memory->create_2d_double_array(nbody,3,"poems:ey_space");
ez_space = memory->create_2d_double_array(nbody,3,"poems:ez_space");
angmom = memory->create_2d_double_array(nbody,3,"poems:angmom");
omega = memory->create_2d_double_array(nbody,3,"poems:omega");
torque = memory->create_2d_double_array(nbody,3,"poems:torque");
memory->create(xcm,nbody,3,"poems:xcm");
memory->create(vcm,nbody,3,"poems:vcm");
memory->create(fcm,nbody,3,"poems:fcm");
memory->create(inertia,nbody,3,"poems:inertia");
memory->create(ex_space,nbody,3,"poems:ex_space");
memory->create(ey_space,nbody,3,"poems:ey_space");
memory->create(ez_space,nbody,3,"poems:ez_space");
memory->create(angmom,nbody,3,"poems:angmom");
memory->create(omega,nbody,3,"poems:omega");
memory->create(torque,nbody,3,"poems:torque");
sum = memory->create_2d_double_array(nbody,6,"poems:sum");
all = memory->create_2d_double_array(nbody,6,"poems:all");
memory->create(sum,nbody,6,"poems:sum");
memory->create(all,nbody,6,"poems:all");
// nrigid[n] = # of atoms in Nth rigid body
// double count joint atoms as being in multiple bodies
@ -273,31 +273,31 @@ FixPOEMS::~FixPOEMS()
// delete locally stored arrays
memory->sfree(natom2body);
memory->destroy_2d_int_array(atom2body);
memory->destroy_2d_double_array(displace);
memory->destroy(atom2body);
memory->destroy(displace);
// delete nbody-length arrays
delete [] nrigid;
delete [] masstotal;
memory->destroy_2d_double_array(xcm);
memory->destroy_2d_double_array(vcm);
memory->destroy_2d_double_array(fcm);
memory->destroy_2d_double_array(inertia);
memory->destroy_2d_double_array(ex_space);
memory->destroy_2d_double_array(ey_space);
memory->destroy_2d_double_array(ez_space);
memory->destroy_2d_double_array(angmom);
memory->destroy_2d_double_array(omega);
memory->destroy_2d_double_array(torque);
memory->destroy(xcm);
memory->destroy(vcm);
memory->destroy(fcm);
memory->destroy(inertia);
memory->destroy(ex_space);
memory->destroy(ey_space);
memory->destroy(ez_space);
memory->destroy(angmom);
memory->destroy(omega);
memory->destroy(torque);
memory->destroy_2d_double_array(sum);
memory->destroy_2d_double_array(all);
memory->destroy(sum);
memory->destroy(all);
// delete joint arrays
memory->destroy_2d_int_array(jointbody);
memory->destroy_2d_double_array(xjoint);
memory->destroy(jointbody);
memory->destroy(xjoint);
delete [] freelist;
// delete POEMS object
@ -440,8 +440,9 @@ void FixPOEMS::init()
// inertia = 3 eigenvalues = principal moments of inertia
// ex_space,ey_space,ez_space = 3 eigenvectors = principal axes of rigid body
double **tensor = memory->create_2d_double_array(3,3,"fix_rigid:tensor");
double **evectors = memory->create_2d_double_array(3,3,"fix_rigid:evectors");
double **tensor,**evectors;
memory->create(tensor,3,3,"fix_rigid:tensor");
memory->create(evectors,3,3,"fix_rigid:evectors");
int ierror;
double ez0,ez1,ez2;
@ -501,8 +502,8 @@ void FixPOEMS::init()
// free temporary memory
memory->destroy_2d_double_array(tensor);
memory->destroy_2d_double_array(evectors);
memory->destroy(tensor);
memory->destroy(evectors);
// displace = initial atom coords in basis of principal axes
// only set joint atoms relative to 1st body
@ -974,7 +975,7 @@ void FixPOEMS::jointbuild()
}
int **mylist = NULL;
if (mjoint) mylist = memory->create_2d_int_array(mjoint,3,"poems:mylist");
if (mjoint) memory->create(mylist,mjoint,3,"poems:mylist");
mjoint = 0;
for (i = 0; i < nlocal; i++) {
@ -991,7 +992,7 @@ void FixPOEMS::jointbuild()
MPI_Allreduce(&mjoint,&njoint,1,MPI_INT,MPI_SUM,world);
int **jlist = NULL;
if (njoint) jlist = memory->create_2d_int_array(njoint,3,"poems:jlist");
if (njoint) memory->create(jlist,njoint,3,"poems:jlist");
int nprocs;
MPI_Comm_size(world,&nprocs);
@ -1052,9 +1053,9 @@ void FixPOEMS::jointbuild()
xjoint = NULL;
double **myjoint = NULL;
if (njoint) {
jointbody = memory->create_2d_int_array(njoint,2,"poems:jointbody");
xjoint = memory->create_2d_double_array(njoint,3,"poems:xjoint");
myjoint = memory->create_2d_double_array(njoint,3,"poems:myjoint");
memory->create(jointbody,njoint,2,"poems:jointbody");
memory->create(xjoint,njoint,3,"poems:xjoint");
memory->create(myjoint,njoint,3,"poems:myjoint");
}
double **x = atom->x;
@ -1095,9 +1096,9 @@ void FixPOEMS::jointbuild()
// free memory local to this routine
memory->destroy_2d_int_array(mylist);
memory->destroy_2d_int_array(jlist);
memory->destroy_2d_double_array(myjoint);
memory->destroy(mylist);
memory->destroy(jlist);
memory->destroy(myjoint);
}
/* ----------------------------------------------------------------------
@ -1161,7 +1162,8 @@ int FixPOEMS::loopcheck(int nvert, int nedge, int **elist)
int emax = 0;
for (i = 0; i < nvert; i++) emax = MAX(emax,ecount[i]);
int **elistfull = memory->create_2d_int_array(nvert,emax,"poems:elistfull");
int **elistfull;
memory->create(elistfull,nvert,emax,"poems:elistfull");
for (i = 0; i < nvert; i++) ecount[i] = 0;
for (i = 0; i < nedge; i++) {
elistfull[elist[i][0]][ecount[elist[i][0]]++] = elist[i][1];
@ -1214,7 +1216,7 @@ int FixPOEMS::loopcheck(int nvert, int nedge, int **elist)
// free memory local to this routine
delete [] ecount;
memory->destroy_2d_int_array(elistfull);
memory->destroy(elistfull);
delete [] parent;
delete [] mark;
delete [] stack;
@ -1524,10 +1526,8 @@ void FixPOEMS::grow_arrays(int nmax)
{
natom2body = (int *)
memory->srealloc(natom2body,nmax*sizeof(int),"fix_poems:natom2body");
atom2body =
memory->grow_2d_int_array(atom2body,nmax,MAXBODY,"fix_poems:atom2body");
displace =
memory->grow_2d_double_array(displace,nmax,3,"fix_poems:displace");
memory->grow(atom2body,nmax,MAXBODY,"fix_poems:atom2body");
memory->grow(displace,nmax,3,"fix_poems:displace");
}
/* ----------------------------------------------------------------------

View File

@ -92,8 +92,8 @@ PairREAX::~PairREAX()
delete [] pvector;
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
for (int i = 1; i <= atom->ntypes; i++)
delete [] param_list[i].params;
@ -471,8 +471,8 @@ void PairREAX::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(setflag,n+1,n+1,"pair:setflag");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
param_list = new ff_params[n+1];
for (int i = 1; i <= n; i++)

View File

@ -59,9 +59,9 @@ FixEvent::~FixEvent()
// delete locally stored array
memory->destroy_2d_double_array(xevent);
memory->destroy_2d_double_array(xold);
memory->destroy_2d_double_array(vold);
memory->destroy(xevent);
memory->destroy(xold);
memory->destroy(vold);
memory->sfree(imageold);
}
@ -178,9 +178,9 @@ double FixEvent::memory_usage()
void FixEvent::grow_arrays(int nmax)
{
xevent = memory->grow_2d_double_array(xevent,nmax,3,"event:xevent");
xold = memory->grow_2d_double_array(xold,nmax,3,"event:xold");
vold = memory->grow_2d_double_array(vold,nmax,3,"event:vold");
memory->grow(xevent,nmax,3,"event:xevent");
memory->grow(xold,nmax,3,"event:xold");
memory->grow(vold,nmax,3,"event:vold");
imageold = (int *)
memory->srealloc(imageold,nmax*sizeof(int),"event:imageold");

View File

@ -78,9 +78,9 @@ FixNEB::~FixNEB()
modify->delete_compute(id_pe);
delete [] id_pe;
memory->destroy_2d_double_array(xprev);
memory->destroy_2d_double_array(xnext);
memory->destroy_2d_double_array(tangent);
memory->destroy(xprev);
memory->destroy(xnext);
memory->destroy(tangent);
}
/* ---------------------------------------------------------------------- */
@ -107,13 +107,13 @@ void FixNEB::init()
// setup xprev and xnext arrays
memory->destroy_2d_double_array(xprev);
memory->destroy_2d_double_array(xnext);
memory->destroy_2d_double_array(tangent);
memory->destroy(xprev);
memory->destroy(xnext);
memory->destroy(tangent);
nebatoms = atom->nlocal;
xprev = memory->create_2d_double_array(nebatoms,3,"neb:xprev");
xnext = memory->create_2d_double_array(nebatoms,3,"neb:xnext");
tangent = memory->create_2d_double_array(nebatoms,3,"neb:tangent");
memory->create(xprev,nebatoms,3,"neb:xprev");
memory->create(xnext,nebatoms,3,"neb:xnext");
memory->create(tangent,nebatoms,3,"neb:tangent");
}
/* ---------------------------------------------------------------------- */

View File

@ -90,7 +90,7 @@ NEB::NEB(LAMMPS *lmp, double etol_in, double ftol_in, int n1steps_in,
NEB::~NEB()
{
MPI_Comm_free(&roots);
memory->destroy_2d_double_array(all);
memory->destroy(all);
delete [] rdist;
}
@ -167,7 +167,7 @@ void NEB::run()
fneb = (FixNEB *) modify->fix[ineb];
nall = 4;
all = memory->create_2d_double_array(nreplica,nall,"neb:all");
memory->create(all,nreplica,nall,"neb:all");
rdist = new double[nreplica];
// initialize LAMMPS

View File

@ -126,7 +126,7 @@ void PRD::command(int narg, char **arg)
if (nreplica != nprocs_universe) {
displacements = new int[nprocs];
tagall = (int *) memory->smalloc(natoms*sizeof(int),"prd:tagall");
xall = memory->create_2d_double_array(natoms,3,"prd:xall");
memory->create(xall,natoms,3,"prd:xall");
imageall = (int *) memory->smalloc(natoms*sizeof(int),"prd:imageall");
}
@ -407,7 +407,7 @@ void PRD::command(int narg, char **arg)
delete [] displacements;
memory->sfree(tagall);
memory->destroy_2d_double_array(xall);
memory->destroy(xall);
memory->sfree(imageall);
MPI_Comm_free(&comm_replica);

View File

@ -265,9 +265,9 @@ FixSRD::~FixSRD()
}
memory->sfree(nbinbig);
memory->destroy_2d_int_array(binbig);
memory->destroy(binbig);
memory->sfree(binsrd);
memory->destroy_2d_int_array(stencil);
memory->destroy(stencil);
memory->sfree(biglist);
}
@ -3123,10 +3123,10 @@ void FixSRD::setup_search_bins()
nbins2 = nbin2x*nbin2y*nbin2z;
if (nbins2 > maxbin2) {
memory->sfree(nbinbig);
memory->destroy_2d_int_array(binbig);
memory->destroy(binbig);
maxbin2 = nbins2;
nbinbig = (int *) memory->smalloc(nbins2*sizeof(int),"fix/srd:nbinbig");
binbig = memory->create_2d_int_array(nbins2,ATOMPERBIN,"fix/srd:binbig");
memory->create(binbig,nbins2,ATOMPERBIN,"fix/srd:binbig");
}
}
@ -3153,9 +3153,9 @@ void FixSRD::setup_search_stencil()
int max = (2*nx+1) * (2*ny+1) * (2*nz+1);
if (max > maxstencil) {
memory->destroy_2d_int_array(stencil);
memory->destroy(stencil);
maxstencil = max;
stencil = memory->create_2d_int_array(max,4,"fix/srd:stencil");
memory->create(stencil,max,4,"fix/srd:stencil");
}
// loop over all bins

View File

@ -116,8 +116,8 @@ FixWallSRD::FixWallSRD(LAMMPS *lmp, int narg, char **arg) :
global_freq = 1;
extarray = 1;
fwall = memory->create_2d_double_array(nwall,3,"wall/srd:fwall");
fwall_all = memory->create_2d_double_array(nwall,3,"wall/srd:fwall_all");
memory->create(fwall,nwall,3,"wall/srd:fwall");
memory->create(fwall_all,nwall,3,"wall/srd:fwall_all");
// scale coord for CONSTANT walls
@ -169,8 +169,8 @@ FixWallSRD::~FixWallSRD()
{
for (int m = 0; m < nwall; m++)
if (wallstyle[m] == VARIABLE) delete [] varstr[m];
memory->destroy_2d_double_array(fwall);
memory->destroy_2d_double_array(fwall_all);
memory->destroy(fwall);
memory->destroy(fwall_all);
}
/* ---------------------------------------------------------------------- */

View File

@ -39,10 +39,10 @@ PairCGCMMCoulCut::PairCGCMMCoulCut(LAMMPS *lmp) : PairCMMCommon(lmp)
PairCGCMMCoulCut::~PairCGCMMCoulCut()
{
if (allocated_coul) {
memory->destroy_2d_double_array(cut_lj);
memory->destroy_2d_double_array(cut_ljsq);
memory->destroy_2d_double_array(cut_coul);
memory->destroy_2d_double_array(cut_coulsq);
memory->destroy(cut_lj);
memory->destroy(cut_ljsq);
memory->destroy(cut_coul);
memory->destroy(cut_coulsq);
allocated_coul=0;
}
}
@ -56,10 +56,10 @@ void PairCGCMMCoulCut::allocate()
int n = atom->ntypes;
cut_lj = memory->create_2d_double_array(n+1,n+1,"paircg:cut_lj");
cut_ljsq = memory->create_2d_double_array(n+1,n+1,"paircg:cut_ljsq");
cut_coul = memory->create_2d_double_array(n+1,n+1,"paircg:cut_coul");
cut_coulsq = memory->create_2d_double_array(n+1,n+1,"paircg:cut_coulsq");
memory->create(cut_lj,n+1,n+1,"paircg:cut_lj");
memory->create(cut_ljsq,n+1,n+1,"paircg:cut_ljsq");
memory->create(cut_coul,n+1,n+1,"paircg:cut_coul");
memory->create(cut_coulsq,n+1,n+1,"paircg:cut_coulsq");
}
/* ---------------------------------------------------------------------- */

View File

@ -42,10 +42,10 @@ PairCGCMMCoulLong::PairCGCMMCoulLong(LAMMPS *lmp) : PairCMMCommon(lmp)
PairCGCMMCoulLong::~PairCGCMMCoulLong()
{
if (allocated_coul) {
memory->destroy_2d_double_array(cut_lj);
memory->destroy_2d_double_array(cut_ljsq);
memory->destroy_2d_double_array(cut_coul);
memory->destroy_2d_double_array(cut_coulsq);
memory->destroy(cut_lj);
memory->destroy(cut_ljsq);
memory->destroy(cut_coul);
memory->destroy(cut_coulsq);
allocated_coul=0;
}
if (ftable) free_tables();
@ -60,10 +60,10 @@ void PairCGCMMCoulLong::allocate()
int n = atom->ntypes;
cut_lj = memory->create_2d_double_array(n+1,n+1,"paircg:cut_lj");
cut_ljsq = memory->create_2d_double_array(n+1,n+1,"paircg:cut_ljsq");
cut_coul = memory->create_2d_double_array(n+1,n+1,"paircg:cut_coul");
cut_coulsq = memory->create_2d_double_array(n+1,n+1,"paircg:cut_coulsq");
memory->create(cut_lj,n+1,n+1,"paircg:cut_lj");
memory->create(cut_ljsq,n+1,n+1,"paircg:cut_ljsq");
memory->create(cut_coul,n+1,n+1,"paircg:cut_coul");
memory->create(cut_coulsq,n+1,n+1,"paircg:cut_coulsq");
}
/* ----------------------------------------------------------------------

View File

@ -46,19 +46,19 @@ PairCMMCommon::PairCMMCommon(class LAMMPS *lmp) : Pair(lmp)
PairCMMCommon::~PairCMMCommon() {
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_int_array(cg_type);
memory->destroy(setflag);
memory->destroy(cg_type);
memory->destroy_2d_double_array(cut);
memory->destroy_2d_double_array(cutsq);
memory->destroy_2d_double_array(epsilon);
memory->destroy_2d_double_array(sigma);
memory->destroy_2d_double_array(offset);
memory->destroy(cut);
memory->destroy(cutsq);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(offset);
memory->destroy_2d_double_array(lj1);
memory->destroy_2d_double_array(lj2);
memory->destroy_2d_double_array(lj3);
memory->destroy_2d_double_array(lj4);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
allocated = 0;
}
@ -73,8 +73,8 @@ void PairCMMCommon::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"paircg:setflag");
cg_type = memory->create_2d_int_array(n+1,n+1,"paircg:cg_type");
memory->create(setflag,n+1,n+1,"paircg:setflag");
memory->create(cg_type,n+1,n+1,"paircg:cg_type");
for (int i = 1; i <= n; i++) {
for (int j = i; j <= n; j++) {
setflag[i][j] = 0;
@ -82,16 +82,16 @@ void PairCMMCommon::allocate()
}
}
cut = memory->create_2d_double_array(n+1,n+1,"paircg:cut");
cutsq = memory->create_2d_double_array(n+1,n+1,"paircg:cutsq");
epsilon = memory->create_2d_double_array(n+1,n+1,"paircg:epsilon");
sigma = memory->create_2d_double_array(n+1,n+1,"paircg:sigma");
offset = memory->create_2d_double_array(n+1,n+1,"paircg:offset");
memory->create(cut,n+1,n+1,"paircg:cut");
memory->create(cutsq,n+1,n+1,"paircg:cutsq");
memory->create(epsilon,n+1,n+1,"paircg:epsilon");
memory->create(sigma,n+1,n+1,"paircg:sigma");
memory->create(offset,n+1,n+1,"paircg:offset");
lj1 = memory->create_2d_double_array(n+1,n+1,"paircg:lj1");
lj2 = memory->create_2d_double_array(n+1,n+1,"paircg:lj2");
lj3 = memory->create_2d_double_array(n+1,n+1,"paircg:lj3");
lj4 = memory->create_2d_double_array(n+1,n+1,"paircg:lj4");
memory->create(lj1,n+1,n+1,"paircg:lj1");
memory->create(lj2,n+1,n+1,"paircg:lj2");
memory->create(lj3,n+1,n+1,"paircg:lj3");
memory->create(lj4,n+1,n+1,"paircg:lj4");
}
/* ----------------------------------------------------------------------

View File

@ -647,9 +647,7 @@ int AtomVecElectron::unpack_restart(double *buf)
if (nlocal == nmax) {
grow(0);
if (atom->nextra_store)
atom->extra = memory->grow_2d_double_array(atom->extra,nmax,
atom->nextra_store,
"atom:extra");
memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra");
}
int m = 1;

View File

@ -62,7 +62,7 @@ ComputeTempDeformEff::ComputeTempDeformEff(LAMMPS *lmp, int narg, char **arg) :
ComputeTempDeformEff::~ComputeTempDeformEff()
{
memory->destroy_2d_double_array(vbiasall);
memory->destroy(vbiasall);
delete [] vector;
}
@ -253,10 +253,9 @@ void ComputeTempDeformEff::remove_bias_all()
int nlocal = atom->nlocal;
if (nlocal > maxbias) {
memory->destroy_2d_double_array(vbiasall);
memory->destroy(vbiasall);
maxbias = atom->nmax;
vbiasall = memory->create_2d_double_array(maxbias,3,
"temp/deform/eff:vbiasall");
memory->create(vbiasall,maxbias,3,"temp/deform/eff:vbiasall");
}
double lamda[3];

View File

@ -64,7 +64,7 @@ ComputeTempRegionEff::ComputeTempRegionEff(LAMMPS *lmp, int narg, char **arg) :
ComputeTempRegionEff::~ComputeTempRegionEff()
{
delete [] idregion;
memory->destroy_2d_double_array(vbiasall);
memory->destroy(vbiasall);
delete [] vector;
}
@ -215,10 +215,9 @@ void ComputeTempRegionEff::remove_bias_all()
int nlocal = atom->nlocal;
if (nlocal > maxbias) {
memory->destroy_2d_double_array(vbiasall);
memory->destroy(vbiasall);
maxbias = atom->nmax;
vbiasall = memory->create_2d_double_array(maxbias,3,
"temp/region:vbiasall");
memory->create(vbiasall,maxbias,3,"temp/region:vbiasall");
}
Region *region = domain->regions[iregion];

View File

@ -121,10 +121,10 @@ void FixLangevinEff::post_force_tally()
// reallocate flangevin if necessary
if (atom->nmax > nmax) {
memory->destroy_2d_double_array(flangevin);
memory->destroy(flangevin);
memory->sfree(erforcelangevin);
nmax = atom->nmax;
flangevin = memory->create_2d_double_array(nmax,3,"langevin:flangevin");
memory->create(flangevin,nmax,3,"langevin:flangevin");
erforcelangevin = (double *)
memory->smalloc(nmax*sizeof(double),"langevin/eff:erforcelangevin");
}

View File

@ -59,9 +59,9 @@ PairEffCut::~PairEffCut()
memory->sfree(min_erforce);
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy_2d_double_array(cut);
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(cut);
}
}
@ -677,13 +677,13 @@ void PairEffCut::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
cut = memory->create_2d_double_array(n+1,n+1,"pair:cut");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(cut,n+1,n+1,"pair:cut");
}
/* ---------------------------------------------------------------------

View File

@ -116,22 +116,22 @@ void PairBuckCoul::settings(int narg, char **arg)
PairBuckCoul::~PairBuckCoul()
{
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy_2d_double_array(cut_buck_read);
memory->destroy_2d_double_array(cut_buck);
memory->destroy_2d_double_array(cut_bucksq);
memory->destroy_2d_double_array(buck_a_read);
memory->destroy_2d_double_array(buck_a);
memory->destroy_2d_double_array(buck_c_read);
memory->destroy_2d_double_array(buck_c);
memory->destroy_2d_double_array(buck_rho_read);
memory->destroy_2d_double_array(buck_rho);
memory->destroy_2d_double_array(buck1);
memory->destroy_2d_double_array(buck2);
memory->destroy_2d_double_array(rhoinv);
memory->destroy_2d_double_array(offset);
memory->destroy(cut_buck_read);
memory->destroy(cut_buck);
memory->destroy(cut_bucksq);
memory->destroy(buck_a_read);
memory->destroy(buck_a);
memory->destroy(buck_c_read);
memory->destroy(buck_c);
memory->destroy(buck_rho_read);
memory->destroy(buck_rho);
memory->destroy(buck1);
memory->destroy(buck2);
memory->destroy(rhoinv);
memory->destroy(offset);
}
if (ftable) free_tables();
}
@ -145,26 +145,26 @@ void PairBuckCoul::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
cut_buck_read = memory->create_2d_double_array(n+1,n+1,"pair:cut_buck_read");
cut_buck = memory->create_2d_double_array(n+1,n+1,"pair:cut_buck");
cut_bucksq = memory->create_2d_double_array(n+1,n+1,"pair:cut_bucksq");
buck_a_read = memory->create_2d_double_array(n+1,n+1,"pair:buck_a_read");
buck_a = memory->create_2d_double_array(n+1,n+1,"pair:buck_a");
buck_c_read = memory->create_2d_double_array(n+1,n+1,"pair:buck_c_read");
buck_c = memory->create_2d_double_array(n+1,n+1,"pair:buck_c");
buck_rho_read = memory->create_2d_double_array(n+1,n+1,"pair:buck_rho_read");
buck_rho = memory->create_2d_double_array(n+1,n+1,"pair:buck_rho");
buck1 = memory->create_2d_double_array(n+1,n+1,"pair:buck1");
buck2 = memory->create_2d_double_array(n+1,n+1,"pair:buck2");
rhoinv = memory->create_2d_double_array(n+1,n+1,"pair:rhoinv");
offset = memory->create_2d_double_array(n+1,n+1,"pair:offset");
memory->create(cut_buck_read,n+1,n+1,"pair:cut_buck_read");
memory->create(cut_buck,n+1,n+1,"pair:cut_buck");
memory->create(cut_bucksq,n+1,n+1,"pair:cut_bucksq");
memory->create(buck_a_read,n+1,n+1,"pair:buck_a_read");
memory->create(buck_a,n+1,n+1,"pair:buck_a");
memory->create(buck_c_read,n+1,n+1,"pair:buck_c_read");
memory->create(buck_c,n+1,n+1,"pair:buck_c");
memory->create(buck_rho_read,n+1,n+1,"pair:buck_rho_read");
memory->create(buck_rho,n+1,n+1,"pair:buck_rho");
memory->create(buck1,n+1,n+1,"pair:buck1");
memory->create(buck2,n+1,n+1,"pair:buck2");
memory->create(rhoinv,n+1,n+1,"pair:rhoinv");
memory->create(offset,n+1,n+1,"pair:offset");
}
/* ----------------------------------------------------------------------

View File

@ -114,21 +114,21 @@ void PairLJCoul::settings(int narg, char **arg)
PairLJCoul::~PairLJCoul()
{
if (allocated) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy_2d_double_array(cut_lj_read);
memory->destroy_2d_double_array(cut_lj);
memory->destroy_2d_double_array(cut_ljsq);
memory->destroy_2d_double_array(epsilon_read);
memory->destroy_2d_double_array(epsilon);
memory->destroy_2d_double_array(sigma_read);
memory->destroy_2d_double_array(sigma);
memory->destroy_2d_double_array(lj1);
memory->destroy_2d_double_array(lj2);
memory->destroy_2d_double_array(lj3);
memory->destroy_2d_double_array(lj4);
memory->destroy_2d_double_array(offset);
memory->destroy(cut_lj_read);
memory->destroy(cut_lj);
memory->destroy(cut_ljsq);
memory->destroy(epsilon_read);
memory->destroy(epsilon);
memory->destroy(sigma_read);
memory->destroy(sigma);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(offset);
}
if (ftable) free_tables();
}
@ -142,25 +142,25 @@ void PairLJCoul::allocate()
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
cut_lj_read = memory->create_2d_double_array(n+1,n+1,"pair:cut_lj_read");
cut_lj = memory->create_2d_double_array(n+1,n+1,"pair:cut_lj");
cut_ljsq = memory->create_2d_double_array(n+1,n+1,"pair:cut_ljsq");
epsilon_read = memory->create_2d_double_array(n+1,n+1,"pair:epsilon_read");
epsilon = memory->create_2d_double_array(n+1,n+1,"pair:epsilon");
sigma_read = memory->create_2d_double_array(n+1,n+1,"pair:sigma_read");
sigma = memory->create_2d_double_array(n+1,n+1,"pair:sigma");
lj1 = memory->create_2d_double_array(n+1,n+1,"pair:lj1");
lj2 = memory->create_2d_double_array(n+1,n+1,"pair:lj2");
lj3 = memory->create_2d_double_array(n+1,n+1,"pair:lj3");
lj4 = memory->create_2d_double_array(n+1,n+1,"pair:lj4");
offset = memory->create_2d_double_array(n+1,n+1,"pair:offset");
memory->create(cut_lj_read,n+1,n+1,"pair:cut_lj_read");
memory->create(cut_lj,n+1,n+1,"pair:cut_lj");
memory->create(cut_ljsq,n+1,n+1,"pair:cut_ljsq");
memory->create(epsilon_read,n+1,n+1,"pair:epsilon_read");
memory->create(epsilon,n+1,n+1,"pair:epsilon");
memory->create(sigma_read,n+1,n+1,"pair:sigma_read");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(lj1,n+1,n+1,"pair:lj1");
memory->create(lj2,n+1,n+1,"pair:lj2");
memory->create(lj3,n+1,n+1,"pair:lj3");
memory->create(lj4,n+1,n+1,"pair:lj4");
memory->create(offset,n+1,n+1,"pair:offset");
}
/* ----------------------------------------------------------------------

View File

@ -110,13 +110,13 @@ FixQEqReax::~FixQEqReax()
atom->delete_callback(id,0);
memory->destroy_2d_double_array(s_hist);
memory->destroy_2d_double_array(t_hist);
memory->destroy(s_hist);
memory->destroy(t_hist);
deallocate_storage();
deallocate_matrix();
memory->destroy_2d_double_array(shld);
memory->destroy(shld);
if (!reaxflag) {
memory->sfree(chi);
@ -315,7 +315,7 @@ void FixQEqReax::init_shielding()
int ntypes;
ntypes = atom->ntypes;
shld = memory->create_2d_double_array(ntypes+1, ntypes+1, "qeq:shileding");
memory->create(shld,ntypes+1,ntypes+1,"qeq:shileding");
for( i = 1; i <= ntypes; ++i )
for( j = 1; j <= ntypes; ++j )
@ -714,8 +714,8 @@ double FixQEqReax::memory_usage()
void FixQEqReax::grow_arrays(int nmax)
{
s_hist = memory->grow_2d_double_array(s_hist,nmax,nprev,"qeq:s_hist");
t_hist = memory->grow_2d_double_array(t_hist,nmax,nprev,"qeq:t_hist");
memory->grow(s_hist,nmax,nprev,"qeq:s_hist");
memory->grow(t_hist,nmax,nprev,"qeq:t_hist");
}
/* ----------------------------------------------------------------------

View File

@ -122,8 +122,8 @@ PairReaxC::~PairReaxC()
// deallocate interface storage
if( allocated ) {
memory->destroy_2d_int_array(setflag);
memory->destroy_2d_double_array(cutsq);
memory->destroy(setflag);
memory->destroy(cutsq);
delete [] map;
delete [] chi;
@ -143,8 +143,8 @@ void PairReaxC::allocate( )
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
memory->create(setflag,n+1,n+1,"pair:setflag");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
map = new int[n+1];
chi = new double[n+1];

View File

@ -40,7 +40,7 @@ Angle::Angle(LAMMPS *lmp) : Pointers(lmp)
Angle::~Angle()
{
memory->sfree(eatom);
memory->destroy_2d_double_array(vatom);
memory->destroy(vatom);
}
/* ----------------------------------------------------------------------
@ -82,8 +82,8 @@ void Angle::ev_setup(int eflag, int vflag)
}
if (vflag_atom && atom->nmax > maxvatom) {
maxvatom = atom->nmax;
memory->destroy_2d_double_array(vatom);
vatom = memory->create_2d_double_array(maxvatom,6,"bond:vatom");
memory->destroy(vatom);
memory->create(vatom,maxvatom,6,"bond:vatom");
}
// zero accumulators

View File

@ -532,9 +532,7 @@ int AtomVecAtomic::unpack_restart(double *buf)
if (nlocal == nmax) {
grow(0);
if (atom->nextra_store)
atom->extra = memory->grow_2d_double_array(atom->extra,nmax,
atom->nextra_store,
"atom:extra");
memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra");
}
int m = 1;

View File

@ -568,9 +568,7 @@ int AtomVecCharge::unpack_restart(double *buf)
if (nlocal == nmax) {
grow(0);
if (atom->nextra_store)
atom->extra = memory->grow_2d_double_array(atom->extra,nmax,
atom->nextra_store,
"atom:extra");
memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra");
}
int m = 1;

View File

@ -730,9 +730,7 @@ int AtomVecHybrid::unpack_restart(double *buf)
if (nlocal == nmax) {
grow(0);
if (atom->nextra_store)
atom->extra = memory->grow_2d_double_array(atom->extra,nmax,
atom->nextra_store,
"atom:extra");
memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra");
}
int tmp = atom->nextra_store;

View File

@ -41,7 +41,7 @@ Bond::Bond(LAMMPS *lmp) : Pointers(lmp)
Bond::~Bond()
{
memory->sfree(eatom);
memory->destroy_2d_double_array(vatom);
memory->destroy(vatom);
}
/* ----------------------------------------------------------------------
@ -84,8 +84,8 @@ void Bond::ev_setup(int eflag, int vflag)
}
if (vflag_atom && atom->nmax > maxvatom) {
maxvatom = atom->nmax;
memory->destroy_2d_double_array(vatom);
vatom = memory->create_2d_double_array(maxvatom,6,"bond:vatom");
memory->destroy(vatom);
memory->create(vatom,maxvatom,6,"bond:vatom");
}
// zero accumulators

View File

@ -51,7 +51,7 @@ BondHybrid::~BondHybrid()
delete [] nbondlist;
delete [] maxbond;
for (int i = 0; i < nstyles; i++)
memory->destroy_2d_int_array(bondlist[i]);
memory->destroy(bondlist[i]);
delete [] bondlist;
}
}
@ -80,10 +80,9 @@ void BondHybrid::compute(int eflag, int vflag)
}
for (m = 0; m < nstyles; m++) {
if (nbondlist[m] > maxbond[m]) {
memory->destroy_2d_int_array(bondlist[m]);
memory->destroy(bondlist[m]);
maxbond[m] = nbondlist[m] + EXTRA;
bondlist[m] = (int **)
memory->create_2d_int_array(maxbond[m],3,"bond_hybrid:bondlist");
memory->create(bondlist[m],maxbond[m],3,"bond_hybrid:bondlist");
}
nbondlist[m] = 0;
}
@ -179,7 +178,7 @@ void BondHybrid::settings(int narg, char **arg)
delete [] nbondlist;
delete [] maxbond;
for (int i = 0; i < nstyles; i++)
memory->destroy_2d_int_array(bondlist[i]);
memory->destroy(bondlist[i]);
delete [] bondlist;
}
allocated = 0;

View File

@ -63,7 +63,7 @@ ComputeAngleLocal::ComputeAngleLocal(LAMMPS *lmp, int narg, char **arg) :
ComputeAngleLocal::~ComputeAngleLocal()
{
memory->sfree(vector);
memory->destroy_2d_double_array(array);
memory->destroy(array);
}
/* ---------------------------------------------------------------------- */
@ -202,9 +202,8 @@ void ComputeAngleLocal::reallocate(int n)
"bond/local:vector");
vector_local = vector;
} else {
memory->destroy_2d_double_array(array);
array = memory->create_2d_double_array(nmax,nvalues,
"bond/local:array");
memory->destroy(array);
memory->create(array,nmax,nvalues,"bond/local:array");
array_local = array;
}
}

View File

@ -146,10 +146,8 @@ ComputeAtomMolecule(LAMMPS *lmp, int narg, char **arg) :
size_vector = nmolecules;
extvector = 0;
} else {
aone = memory->create_2d_double_array(nmolecules,nvalues,
"atom/molecule:aone");
array = memory->create_2d_double_array(nmolecules,nvalues,
"atom/molecule:array");
memory->create(aone,nmolecules,nvalues,"atom/molecule:aone");
memory->create(array,nmolecules,nvalues,"atom/molecule:array");
array_flag = 1;
size_array_rows = nmolecules;
size_array_cols = nvalues;
@ -172,8 +170,8 @@ ComputeAtomMolecule::~ComputeAtomMolecule()
memory->sfree(vone);
memory->sfree(vector);
memory->destroy_2d_double_array(aone);
memory->destroy_2d_double_array(array);
memory->destroy(aone);
memory->destroy(array);
memory->sfree(scratch);
}

View File

@ -63,7 +63,7 @@ ComputeBondLocal::ComputeBondLocal(LAMMPS *lmp, int narg, char **arg) :
ComputeBondLocal::~ComputeBondLocal()
{
memory->sfree(vector);
memory->destroy_2d_double_array(array);
memory->destroy(array);
}
/* ---------------------------------------------------------------------- */
@ -177,9 +177,8 @@ void ComputeBondLocal::reallocate(int n)
"bond/local:vector");
vector_local = vector;
} else {
memory->destroy_2d_double_array(array);
array = memory->create_2d_double_array(nmax,nvalues,
"bond/local:array");
memory->destroy(array);
memory->create(array,nmax,nvalues,"bond/local:array");
array_local = array;
}
}

View File

@ -66,7 +66,7 @@ ComputeCNAAtom::ComputeCNAAtom(LAMMPS *lmp, int narg, char **arg) :
ComputeCNAAtom::~ComputeCNAAtom()
{
memory->destroy_2d_int_array(nearest);
memory->destroy(nearest);
memory->sfree(nnearest);
memory->sfree(pattern);
}
@ -127,12 +127,12 @@ void ComputeCNAAtom::compute_peratom()
// grow arrays if necessary
if (atom->nlocal > nmax) {
memory->destroy_2d_int_array(nearest);
memory->destroy(nearest);
memory->sfree(nnearest);
memory->sfree(pattern);
nmax = atom->nmax;
nearest = memory->create_2d_int_array(nmax,MAXNEAR,"cna:nearest");
memory->create(nearest,nmax,MAXNEAR,"cna:nearest");
nnearest = (int *) memory->smalloc(nmax*sizeof(int),"cna:nnearest");
pattern = (double *) memory->smalloc(nmax*sizeof(double),
"cna:cna_pattern");

View File

@ -43,8 +43,8 @@ ComputeCOMMolecule::ComputeCOMMolecule(LAMMPS *lmp, int narg, char **arg) :
"com/molecule:massproc");
masstotal = (double *) memory->smalloc(nmolecules*sizeof(double),
"com/molecule:masstotal");
com = memory->create_2d_double_array(nmolecules,3,"com/molecule:com");
comall = memory->create_2d_double_array(nmolecules,3,"com/molecule:comall");
memory->create(com,nmolecules,3,"com/molecule:com");
memory->create(comall,nmolecules,3,"com/molecule:comall");
array = comall;
// compute masstotal for each molecule
@ -80,8 +80,8 @@ ComputeCOMMolecule::~ComputeCOMMolecule()
{
memory->sfree(massproc);
memory->sfree(masstotal);
memory->destroy_2d_double_array(com);
memory->destroy_2d_double_array(comall);
memory->destroy(com);
memory->destroy(comall);
}
/* ---------------------------------------------------------------------- */

View File

@ -66,7 +66,7 @@ ComputeDihedralLocal::ComputeDihedralLocal(LAMMPS *lmp, int narg, char **arg) :
ComputeDihedralLocal::~ComputeDihedralLocal()
{
memory->sfree(vector);
memory->destroy_2d_double_array(array);
memory->destroy(array);
}
/* ---------------------------------------------------------------------- */
@ -219,9 +219,8 @@ void ComputeDihedralLocal::reallocate(int n)
"bond/local:vector");
vector_local = vector;
} else {
memory->destroy_2d_double_array(array);
array = memory->create_2d_double_array(nmax,nvalues,
"bond/local:array");
memory->destroy(array);
memory->create(array,nmax,nvalues,"bond/local:array");
array_local = array;
}
}

View File

@ -67,7 +67,7 @@ ComputeDisplaceAtom::~ComputeDisplaceAtom()
if (modify->nfix) modify->delete_fix(id_fix);
delete [] id_fix;
memory->destroy_2d_double_array(displace);
memory->destroy(displace);
}
/* ---------------------------------------------------------------------- */
@ -90,10 +90,9 @@ void ComputeDisplaceAtom::compute_peratom()
// grow local displacement array if necessary
if (atom->nlocal > nmax) {
memory->destroy_2d_double_array(displace);
memory->destroy(displace);
nmax = atom->nmax;
displace =
memory->create_2d_double_array(nmax,4,"displace/atom:displace");
memory->create(displace,nmax,4,"displace/atom:displace");
array_atom = displace;
}

View File

@ -44,9 +44,8 @@ ComputeGyrationMolecule::ComputeGyrationMolecule(LAMMPS *lmp,
"gyration/molecule:massproc");
masstotal = (double *) memory->smalloc(nmolecules*sizeof(double),
"gyration/molecule:masstotal");
com = memory->create_2d_double_array(nmolecules,3,"gyration/molecule:com");
comall = memory->create_2d_double_array(nmolecules,3,
"gyration/molecule:comall");
memory->create(com,nmolecules,3,"gyration/molecule:com");
memory->create(comall,nmolecules,3,"gyration/molecule:comall");
rg = (double *) memory->smalloc(nmolecules*sizeof(double),
"gyration/molecule:rg");
rgall = (double *) memory->smalloc(nmolecules*sizeof(double),
@ -86,8 +85,8 @@ ComputeGyrationMolecule::~ComputeGyrationMolecule()
{
memory->sfree(massproc);
memory->sfree(masstotal);
memory->destroy_2d_double_array(com);
memory->destroy_2d_double_array(comall);
memory->destroy(com);
memory->destroy(comall);
memory->sfree(rg);
memory->sfree(rgall);
}

View File

@ -64,7 +64,7 @@ ComputeImproperLocal::ComputeImproperLocal(LAMMPS *lmp, int narg, char **arg) :
ComputeImproperLocal::~ComputeImproperLocal()
{
memory->sfree(vector);
memory->destroy_2d_double_array(array);
memory->destroy(array);
}
/* ---------------------------------------------------------------------- */
@ -214,9 +214,8 @@ void ComputeImproperLocal::reallocate(int n)
"bond/local:vector");
vector_local = vector;
} else {
memory->destroy_2d_double_array(array);
array = memory->create_2d_double_array(nmax,nvalues,
"bond/local:array");
memory->destroy(array);
memory->create(array,nmax,nvalues,"bond/local:array");
array_local = array;
}
}

View File

@ -43,11 +43,10 @@ ComputeMSDMolecule::ComputeMSDMolecule(LAMMPS *lmp, int narg, char **arg) :
"msd/molecule:massproc");
masstotal = (double *) memory->smalloc(nmolecules*sizeof(double),
"msd/molecule:masstotal");
com = memory->create_2d_double_array(nmolecules,3,"msd/molecule:com");
comall = memory->create_2d_double_array(nmolecules,3,"msd/molecule:comall");
cominit = memory->create_2d_double_array(nmolecules,3,
"msd/molecule:cominit");
msd = memory->create_2d_double_array(nmolecules,4,"msd/molecule:msd");
memory->create(com,nmolecules,3,"msd/molecule:com");
memory->create(comall,nmolecules,3,"msd/molecule:comall");
memory->create(cominit,nmolecules,3,"msd/molecule:cominit");
memory->create(msd,nmolecules,4,"msd/molecule:msd");
array = msd;
// compute masstotal for each molecule
@ -94,10 +93,10 @@ ComputeMSDMolecule::~ComputeMSDMolecule()
{
memory->sfree(massproc);
memory->sfree(masstotal);
memory->destroy_2d_double_array(com);
memory->destroy_2d_double_array(comall);
memory->destroy_2d_double_array(cominit);
memory->destroy_2d_double_array(msd);
memory->destroy(com);
memory->destroy(comall);
memory->destroy(cominit);
memory->destroy(msd);
}
/* ---------------------------------------------------------------------- */

View File

@ -63,7 +63,7 @@ ComputePairLocal::ComputePairLocal(LAMMPS *lmp, int narg, char **arg) :
ComputePairLocal::~ComputePairLocal()
{
memory->sfree(vector);
memory->destroy_2d_double_array(array);
memory->destroy(array);
}
/* ---------------------------------------------------------------------- */
@ -218,9 +218,8 @@ void ComputePairLocal::reallocate(int n)
"pair/local:vector");
vector_local = vector;
} else {
memory->destroy_2d_double_array(array);
array = memory->create_2d_double_array(nmax,nvalues,
"pair/local:array");
memory->destroy(array);
memory->create(array,nmax,nvalues,"pair/local:array");
array_local = array;
}
}

View File

@ -232,7 +232,7 @@ ComputePropertyAtom::~ComputePropertyAtom()
{
delete [] pack_choice;
memory->sfree(vector);
memory->destroy_2d_double_array(array);
memory->destroy(array);
}
/* ---------------------------------------------------------------------- */
@ -251,9 +251,8 @@ void ComputePropertyAtom::compute_peratom()
"property/atom:vector");
vector_atom = vector;
} else {
memory->destroy_2d_double_array(array);
array = memory->create_2d_double_array(nmax,nvalues,
"property/atom:array");
memory->destroy(array);
memory->create(array,nmax,nvalues,"property/atom:array");
array_atom = array;
}
}

View File

@ -187,8 +187,8 @@ ComputePropertyLocal::~ComputePropertyLocal()
{
delete [] pack_choice;
memory->sfree(vector);
memory->destroy_2d_double_array(array);
memory->destroy_2d_int_array(indices);
memory->destroy(array);
memory->destroy(indices);
}
/* ---------------------------------------------------------------------- */
@ -535,14 +535,13 @@ void ComputePropertyLocal::reallocate(int n)
"property/local:vector");
vector_local = vector;
} else {
memory->destroy_2d_double_array(array);
array = memory->create_2d_double_array(nmax,nvalues,
"property/local:array");
memory->destroy(array);
memory->create(array,nmax,nvalues,"property/local:array");
array_local = array;
}
memory->destroy_2d_int_array(indices);
indices = memory->create_2d_int_array(nmax,2,"property/local:indices");
memory->destroy(indices);
memory->create(indices,nmax,2,"property/local:indices");
}
/* ----------------------------------------------------------------------

View File

@ -60,8 +60,7 @@ ComputePropertyMolecule(LAMMPS *lmp, int narg, char **arg) :
size_vector = nmolecules;
extvector = 0;
} else {
array = memory->create_2d_double_array(nmolecules,nvalues,
"property/molecule:array");
memory->create(array,nmolecules,nvalues,"property/molecule:array");
array_flag = 1;
size_array_rows = nmolecules;
size_array_cols = nvalues;
@ -86,7 +85,7 @@ ComputePropertyMolecule::~ComputePropertyMolecule()
{
delete [] pack_choice;
memory->sfree(vector);
memory->destroy_2d_double_array(array);
memory->destroy(array);
}
/* ---------------------------------------------------------------------- */

View File

@ -87,9 +87,9 @@ ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) :
for (j = jlo[m]; j <= jhi[m]; j++)
rdfpair[nrdfpair[i][j]++][i][j] = m;
hist = memory->create_2d_double_array(npairs,nbin,"rdf:hist");
histall = memory->create_2d_double_array(npairs,nbin,"rdf:histall");
array = memory->create_2d_double_array(nbin,1+2*npairs,"rdf:array");
memory->create(hist,npairs,nbin,"rdf:hist");
memory->create(histall,npairs,nbin,"rdf:histall");
memory->create(array,nbin,1+2*npairs,"rdf:array");
typecount = new int[ntypes+1];
icount = new int[npairs];
jcount = new int[npairs];
@ -100,14 +100,14 @@ ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) :
ComputeRDF::~ComputeRDF()
{
memory->destroy(rdfpair);
memory->destroy_2d_int_array(nrdfpair);
memory->destroy(nrdfpair);
delete [] ilo;
delete [] ihi;
delete [] jlo;
delete [] jhi;
memory->destroy_2d_double_array(hist);
memory->destroy_2d_double_array(histall);
memory->destroy_2d_double_array(array);
memory->destroy(hist);
memory->destroy(histall);
memory->destroy(array);
delete [] typecount;
delete [] icount;
delete [] jcount;

View File

@ -79,7 +79,7 @@ ComputeStressAtom::ComputeStressAtom(LAMMPS *lmp, int narg, char **arg) :
ComputeStressAtom::~ComputeStressAtom()
{
memory->destroy_2d_double_array(stress);
memory->destroy(stress);
}
/* ---------------------------------------------------------------------- */
@ -97,10 +97,9 @@ void ComputeStressAtom::compute_peratom()
// needs to be atom->nmax in length
if (atom->nmax > nmax) {
memory->destroy_2d_double_array(stress);
memory->destroy(stress);
nmax = atom->nmax;
stress =
memory->create_2d_double_array(nmax,6,"stress/atom:stress");
memory->create(stress,nmax,6,"stress/atom:stress");
array_atom = stress;
}

View File

@ -57,7 +57,7 @@ ComputeTempDeform::ComputeTempDeform(LAMMPS *lmp, int narg, char **arg) :
ComputeTempDeform::~ComputeTempDeform()
{
memory->destroy_2d_double_array(vbiasall);
memory->destroy(vbiasall);
delete [] vector;
}
@ -224,10 +224,9 @@ void ComputeTempDeform::remove_bias_all()
int nlocal = atom->nlocal;
if (nlocal > maxbias) {
memory->destroy_2d_double_array(vbiasall);
memory->destroy(vbiasall);
maxbias = atom->nmax;
vbiasall = memory->create_2d_double_array(maxbias,3,
"temp/deform:vbiasall");
memory->create(vbiasall,maxbias,3,"temp/deform:vbiasall");
}
double lamda[3];

View File

@ -55,7 +55,7 @@ ComputeTempPartial::ComputeTempPartial(LAMMPS *lmp, int narg, char **arg) :
ComputeTempPartial::~ComputeTempPartial()
{
memory->destroy_2d_double_array(vbiasall);
memory->destroy(vbiasall);
delete [] vector;
}
@ -190,10 +190,9 @@ void ComputeTempPartial::remove_bias_all()
int nlocal = atom->nlocal;
if (nlocal > maxbias) {
memory->destroy_2d_double_array(vbiasall);
memory->destroy(vbiasall);
maxbias = atom->nmax;
vbiasall = memory->create_2d_double_array(maxbias,3,
"temp/partial:vbiasall");
memory->create(vbiasall,maxbias,3,"temp/partial:vbiasall");
}
if (!xflag) {

View File

@ -97,9 +97,8 @@ ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) :
nbins = nbinx*nbiny*nbinz;
if (nbins <= 0) error->all("Illegal compute temp/profile command");
vbin = memory->create_2d_double_array(nbins,ncount+1,"temp/profile:vbin");
binave = memory->create_2d_double_array(nbins,ncount+1,
"temp/profile:binave");
memory->create(vbin,nbins,ncount+1,"temp/profile:vbin");
memory->create(binave,nbins,ncount+1,"temp/profile:binave");
maxatom = 0;
bin = NULL;
@ -113,10 +112,10 @@ ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) :
ComputeTempProfile::~ComputeTempProfile()
{
memory->destroy_2d_double_array(vbin);
memory->destroy_2d_double_array(binave);
memory->destroy(vbin);
memory->destroy(binave);
memory->sfree(bin);
memory->destroy_2d_double_array(vbiasall);
memory->destroy(vbiasall);
delete [] vector;
}
@ -280,10 +279,9 @@ void ComputeTempProfile::remove_bias_all()
int nlocal = atom->nlocal;
if (nlocal > maxbias) {
memory->destroy_2d_double_array(vbiasall);
memory->destroy(vbiasall);
maxbias = atom->nmax;
vbiasall = memory->create_2d_double_array(maxbias,3,
"temp/profile:vbiasall");
memory->create(vbiasall,maxbias,3,"temp/profile:vbiasall");
}
int ibin;

View File

@ -115,7 +115,7 @@ ComputeTempRamp::ComputeTempRamp(LAMMPS *lmp, int narg, char **arg) :
ComputeTempRamp::~ComputeTempRamp()
{
memory->destroy_2d_double_array(vbiasall);
memory->destroy(vbiasall);
delete [] vector;
}
@ -251,10 +251,9 @@ void ComputeTempRamp::remove_bias_all()
int nlocal = atom->nlocal;
if (nlocal > maxbias) {
memory->destroy_2d_double_array(vbiasall);
memory->destroy(vbiasall);
maxbias = atom->nmax;
vbiasall = memory->create_2d_double_array(maxbias,3,
"temp/ramp:vbiasall");
memory->create(vbiasall,maxbias,3,"temp/ramp:vbiasall");
}
double fraction;

View File

@ -56,7 +56,7 @@ ComputeTempRegion::ComputeTempRegion(LAMMPS *lmp, int narg, char **arg) :
ComputeTempRegion::~ComputeTempRegion()
{
delete [] idregion;
memory->destroy_2d_double_array(vbiasall);
memory->destroy(vbiasall);
delete [] vector;
}
@ -190,10 +190,9 @@ void ComputeTempRegion::remove_bias_all()
int nlocal = atom->nlocal;
if (nlocal > maxbias) {
memory->destroy_2d_double_array(vbiasall);
memory->destroy(vbiasall);
maxbias = atom->nmax;
vbiasall = memory->create_2d_double_array(maxbias,3,
"temp/region:vbiasall");
memory->create(vbiasall,maxbias,3,"temp/region:vbiasall");
}
Region *region = domain->regions[iregion];

View File

@ -44,7 +44,7 @@ Dihedral::Dihedral(LAMMPS *lmp) : Pointers(lmp)
Dihedral::~Dihedral()
{
memory->sfree(eatom);
memory->destroy_2d_double_array(vatom);
memory->destroy(vatom);
}
/* ----------------------------------------------------------------------
@ -87,8 +87,8 @@ void Dihedral::ev_setup(int eflag, int vflag)
}
if (vflag_atom && atom->nmax > maxvatom) {
maxvatom = atom->nmax;
memory->destroy_2d_double_array(vatom);
vatom = memory->create_2d_double_array(maxvatom,6,"bond:vatom");
memory->destroy(vatom);
memory->create(vatom,maxvatom,6,"bond:vatom");
}
// zero accumulators

View File

@ -101,7 +101,7 @@ DumpCFG::~DumpCFG()
delete [] typenames;
}
if (rbuf) memory->destroy_2d_double_array(rbuf);
if (rbuf) memory->destroy(rbuf);
if (auxname) {
for (int i = 0; i < nfield-5; i++) delete [] auxname[i];
@ -230,8 +230,8 @@ void DumpCFG::write_header(bigint n)
// allocate memory needed for data rearrangement on writing proc(s)
if (multiproc || me == 0) {
if (rbuf) memory->destroy_2d_double_array(rbuf);
rbuf = memory->create_2d_double_array(nchosen,size_one,"dump:rbuf");
if (rbuf) memory->destroy(rbuf);
memory->create(rbuf,nchosen,size_one,"dump:rbuf");
}
}

View File

@ -96,7 +96,7 @@ Fix::~Fix()
{
delete [] id;
delete [] style;
memory->destroy_2d_double_array(vatom);
memory->destroy(vatom);
}
/* ----------------------------------------------------------------------
@ -142,8 +142,8 @@ void Fix::v_setup(int vflag)
if (vflag_atom && atom->nlocal > maxvatom) {
maxvatom = atom->nmax;
memory->destroy_2d_double_array(vatom);
vatom = memory->create_2d_double_array(maxvatom,6,"bond:vatom");
memory->destroy(vatom);
memory->create(vatom,maxvatom,6,"bond:vatom");
}
// zero accumulators

View File

@ -146,10 +146,8 @@ FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
int n = atom->ntypes;
for (int m = 0; m < nadapt; m++)
if (adapt[m].which == PAIR) {
adapt[m].array_orig =
memory->create_2d_double_array(n+1,n+1,"adapt:array_orig");
}
if (adapt[m].which == PAIR)
memory->create(adapt[m].array_orig,n+1,n+1,"adapt:array_orig");
}
/* ---------------------------------------------------------------------- */
@ -161,7 +159,7 @@ FixAdapt::~FixAdapt()
if (adapt[m].which == PAIR) {
delete [] adapt[m].pstyle;
delete [] adapt[m].pparam;
memory->destroy_2d_double_array(adapt[m].array_orig);
memory->destroy(adapt[m].array_orig);
}
}
delete [] adapt;

Some files were not shown because too many files have changed in this diff Show More