diff --git a/src/ASPHERE/atom_vec_ellipsoid.cpp b/src/ASPHERE/atom_vec_ellipsoid.cpp index 9a0b7d735fb078f24b209d67c87d7b2bbb76aa9b..4ddbef607cd5683333797a82f6c7f0deb7e7cf54 100755 --- a/src/ASPHERE/atom_vec_ellipsoid.cpp +++ b/src/ASPHERE/atom_vec_ellipsoid.cpp @@ -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; diff --git a/src/ASPHERE/compute_erotate_asphere.cpp b/src/ASPHERE/compute_erotate_asphere.cpp index 91e404486b836bec3a68b8d7434737e3b13502f6..b7c6302eba8ccffb1f324d79fdaf920e9b167e26 100644 --- a/src/ASPHERE/compute_erotate_asphere.cpp +++ b/src/ASPHERE/compute_erotate_asphere.cpp @@ -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); } /* ---------------------------------------------------------------------- */ diff --git a/src/ASPHERE/compute_temp_asphere.cpp b/src/ASPHERE/compute_temp_asphere.cpp index 8f4af98aba49112b5b6d3ffac2ba924b902cdd30..3a0ccbee4af4eb13af117ba482a72a02af7d6bb6 100755 --- a/src/ASPHERE/compute_temp_asphere.cpp +++ b/src/ASPHERE/compute_temp_asphere.cpp @@ -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); } /* ---------------------------------------------------------------------- */ diff --git a/src/ASPHERE/fix_nh_asphere.cpp b/src/ASPHERE/fix_nh_asphere.cpp index 224d25f7e2ff7aeab54bd27085e5e01702052e48..ddf5d1b8db5a212e25359d5e4bdad87b46c0466b 100644 --- a/src/ASPHERE/fix_nh_asphere.cpp +++ b/src/ASPHERE/fix_nh_asphere.cpp @@ -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); } /* ---------------------------------------------------------------------- */ diff --git a/src/ASPHERE/fix_nve_asphere.cpp b/src/ASPHERE/fix_nve_asphere.cpp index 11152cf66bee84cd5333f46ec35f98ab0f13842e..4ddf05081d2580c53f844e3fa09e498210ca4c6a 100755 --- a/src/ASPHERE/fix_nve_asphere.cpp +++ b/src/ASPHERE/fix_nve_asphere.cpp @@ -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); } /* ---------------------------------------------------------------------- */ diff --git a/src/ASPHERE/pair_gayberne.cpp b/src/ASPHERE/pair_gayberne.cpp index ff8c835e1223eda6eb6c211962d2053150f8be0c..aa0d0c2a726b6d2aa3c5145bfc627d09e8b5def8 100755 --- a/src/ASPHERE/pair_gayberne.cpp +++ b/src/ASPHERE/pair_gayberne.cpp @@ -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_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(setflag); + memory->destroy(cutsq); + + 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"); - - 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(cutsq,n+1,n+1,"pair:cutsq"); + + 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]; diff --git a/src/ASPHERE/pair_resquared.cpp b/src/ASPHERE/pair_resquared.cpp index 2f12d864d3b1e6a0dd1d6d664eafa0d8aa14daf1..4be78b42d659853a36ddb7615af9e10fb63ae415 100755 --- a/src/ASPHERE/pair_resquared.cpp +++ b/src/ASPHERE/pair_resquared.cpp @@ -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_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(setflag); + memory->destroy(cutsq); + + 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"); - - 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(cutsq,n+1,n+1,"pair:cutsq"); + + 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]; diff --git a/src/CLASS2/pair_lj_class2.cpp b/src/CLASS2/pair_lj_class2.cpp index 77c66200d16e1aff1b4d1f8bc9ba1d382d6c2561..9b6f41893f74dacf2a4a3d1daa71066c6da5d5d9 100644 --- a/src/CLASS2/pair_lj_class2.cpp +++ b/src/CLASS2/pair_lj_class2.cpp @@ -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_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(setflag); + memory->destroy(cutsq); + + 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"); } /* ---------------------------------------------------------------------- diff --git a/src/CLASS2/pair_lj_class2_coul_cut.cpp b/src/CLASS2/pair_lj_class2_coul_cut.cpp index b6a16883c1079c3d605bc32dd80cd85ee0535341..8c8dc7e22880cadcadf305389296f26c26442545 100644 --- a/src/CLASS2/pair_lj_class2_coul_cut.cpp +++ b/src/CLASS2/pair_lj_class2_coul_cut.cpp @@ -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_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(setflag); + memory->destroy(cutsq); + + 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"); - - 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(cutsq,n+1,n+1,"pair:cutsq"); + + 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"); } /* ---------------------------------------------------------------------- diff --git a/src/CLASS2/pair_lj_class2_coul_long.cpp b/src/CLASS2/pair_lj_class2_coul_long.cpp index 1344dfb7e7bdbb15abf1efcca2674a541c7e631e..f714d1cc851b006f0288b2e9dfc9b51466547233 100644 --- a/src/CLASS2/pair_lj_class2_coul_long.cpp +++ b/src/CLASS2/pair_lj_class2_coul_long.cpp @@ -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_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(setflag); + memory->destroy(cutsq); + + 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"); - - 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(cutsq,n+1,n+1,"pair:cutsq"); + + 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"); } /* ---------------------------------------------------------------------- diff --git a/src/COLLOID/atom_vec_colloid.cpp b/src/COLLOID/atom_vec_colloid.cpp index 001a8c86378868d140ca8e8b6951e16e0c374309..2f71e334721a71042203f320669e062853f7dc59 100644 --- a/src/COLLOID/atom_vec_colloid.cpp +++ b/src/COLLOID/atom_vec_colloid.cpp @@ -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; diff --git a/src/COLLOID/pair_colloid.cpp b/src/COLLOID/pair_colloid.cpp index 7af1410ed84a9715da72146d583cd6f24df08c3e..8bd67abfacf4ceb32eba0a585520b050561ba820 100644 --- a/src/COLLOID/pair_colloid.cpp +++ b/src/COLLOID/pair_colloid.cpp @@ -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_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(setflag); + memory->destroy(cutsq); + + 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"); - - 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(cutsq,n+1,n+1,"pair:cutsq"); + + 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"); } /* ---------------------------------------------------------------------- diff --git a/src/COLLOID/pair_lubricate.cpp b/src/COLLOID/pair_lubricate.cpp index b708794ded26fae9d250c761904a2618dc829d05..43ec4031ecbe791308466262e0cf5272c6e980dc 100644 --- a/src/COLLOID/pair_lubricate.cpp +++ b/src/COLLOID/pair_lubricate.cpp @@ -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"); } /* ---------------------------------------------------------------------- diff --git a/src/DIPOLE/atom_vec_dipole.cpp b/src/DIPOLE/atom_vec_dipole.cpp index 18985e8bb4f4dd026d958ce8c85a94eb5bfd4bbb..d033175301261f44107808f46a4f895a1ee7e83d 100644 --- a/src/DIPOLE/atom_vec_dipole.cpp +++ b/src/DIPOLE/atom_vec_dipole.cpp @@ -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; diff --git a/src/DIPOLE/pair_dipole_cut.cpp b/src/DIPOLE/pair_dipole_cut.cpp index bb8995e84814ae25ee3f48392f6db46cadac2e66..20fc4076d07ce81eddc5ec57e76d56c1a19c46a2 100644 --- a/src/DIPOLE/pair_dipole_cut.cpp +++ b/src/DIPOLE/pair_dipole_cut.cpp @@ -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_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(setflag); + memory->destroy(cutsq); + + 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"); - - 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(cutsq,n+1,n+1,"pair:cutsq"); + + 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"); } /* ---------------------------------------------------------------------- diff --git a/src/DSMC/pair_dsmc.cpp b/src/DSMC/pair_dsmc.cpp index 090f2af79621be061094f3b6b0ccb1ffd6a5c872..b04dd8f6d7432ce8e8d12593ba56296e66367592 100644 --- a/src/DSMC/pair_dsmc.cpp +++ b/src/DSMC/pair_dsmc.cpp @@ -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++) diff --git a/src/GRANULAR/atom_vec_granular.cpp b/src/GRANULAR/atom_vec_granular.cpp index 652ea57bf70607ff04b3e09276975b84569af04a..e934796f61c7678410bdbec2a217e7ca9ee06472 100644 --- a/src/GRANULAR/atom_vec_granular.cpp +++ b/src/GRANULAR/atom_vec_granular.cpp @@ -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; diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp index 0f54bbf79b251bf1139a2bcb71b3ed6c9899d4a3..73b9d4991483cc29db1440d6046954dbe5217101 100644 --- a/src/GRANULAR/fix_pour.cpp +++ b/src/GRANULAR/fix_pour.cpp @@ -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 diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 5331ce1f6f3068ae201279e57bb05197503c625d..4b60f96714b178d802a1b27bed05f301faf7800b 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -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"); } /* ---------------------------------------------------------------------- diff --git a/src/GRANULAR/pair_gran_hooke_history.cpp b/src/GRANULAR/pair_gran_hooke_history.cpp index 3127621fef8ee297ed52a0cb07f018011a32e19f..fbf7043098866306caec57a5ea7397b9ea74342b 100644 --- a/src/GRANULAR/pair_gran_hooke_history.cpp +++ b/src/GRANULAR/pair_gran_hooke_history.cpp @@ -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]; diff --git a/src/KSPACE/ewald.cpp b/src/KSPACE/ewald.cpp index 24719646dc8259ea849cc3dafbe54a627327ce40..ad7a5923ecfc124e6c5f191befe2fcafa4520ab8 100644 --- a/src/KSPACE/ewald.cpp +++ b/src/KSPACE/ewald.cpp @@ -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; diff --git a/src/KSPACE/pair_born_coul_long.cpp b/src/KSPACE/pair_born_coul_long.cpp index b1505a3af65ce60543112a4a1096021b0dd4c1c7..493071bcbe794c815de91a8038d1709052b37916 100644 --- a/src/KSPACE/pair_born_coul_long.cpp +++ b/src/KSPACE/pair_born_coul_long.cpp @@ -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_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(setflag); + memory->destroy(cutsq); + + 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"); - - 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(cutsq,n+1,n+1,"pair:cutsq"); + + 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"); } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pair_buck_coul_long.cpp b/src/KSPACE/pair_buck_coul_long.cpp index 800900cdc20588e91e4c58f2b145c877871b4670..1cf9d0a49d1c626fed218e8e585fb48ba32038ac 100644 --- a/src/KSPACE/pair_buck_coul_long.cpp +++ b/src/KSPACE/pair_buck_coul_long.cpp @@ -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_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(setflag); + memory->destroy(cutsq); + + 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"); - - 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(cutsq,n+1,n+1,"pair:cutsq"); + + 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"); } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pair_coul_long.cpp b/src/KSPACE/pair_coul_long.cpp index 65ef65d07d3c79e796f934d974183a6d3a679c7d..b49d44a0d0b4a1eb48ff978224bf2c51e6f8cc51 100644 --- a/src/KSPACE/pair_coul_long.cpp +++ b/src/KSPACE/pair_coul_long.cpp @@ -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"); } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pair_lj_charmm_coul_long.cpp b/src/KSPACE/pair_lj_charmm_coul_long.cpp index 66f84440f2c2b9b9ff0c4e07cf571bab46aa7af4..d8b2b1c487feb7103d1d12335fcdf33d64324caa 100644 --- a/src/KSPACE/pair_lj_charmm_coul_long.cpp +++ b/src/KSPACE/pair_lj_charmm_coul_long.cpp @@ -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_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(setflag); + memory->destroy(cutsq); + + 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"); - - 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(cutsq,n+1,n+1,"pair:cutsq"); + + 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"); } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pair_lj_cut_coul_long.cpp b/src/KSPACE/pair_lj_cut_coul_long.cpp index 74056b96c5c469bc5778464d78e5963e33d4ed73..cff7bf5df8b2311d660b01bd7bde9d62f4315728 100644 --- a/src/KSPACE/pair_lj_cut_coul_long.cpp +++ b/src/KSPACE/pair_lj_cut_coul_long.cpp @@ -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_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(setflag); + memory->destroy(cutsq); + + 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"); - - 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(cutsq,n+1,n+1,"pair:cutsq"); + + 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"); } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pppm.cpp b/src/KSPACE/pppm.cpp index 2306528fed152de1e57ce0b0e2e47430144e175f..ab211f3d3a7064593c2145c6d3dfd5502c88976b 100644 --- a/src/KSPACE/pppm.cpp +++ b/src/KSPACE/pppm.cpp @@ -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); } /* ---------------------------------------------------------------------- diff --git a/src/MANYBODY/pair_airebo.cpp b/src/MANYBODY/pair_airebo.cpp index 28b2721212d37cdc4801b9ebdb708dc666fb5782..16fa7e80c15d6add0e9240bddfbc5b642e35753d 100644 --- a/src/MANYBODY/pair_airebo.cpp +++ b/src/MANYBODY/pair_airebo.cpp @@ -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_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(setflag); + memory->destroy(cutsq); + memory->destroy(cutghost); + + 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]; } diff --git a/src/MANYBODY/pair_comb.cpp b/src/MANYBODY/pair_comb.cpp index 7d462af082d3058b170f37df6e2fa6cd4b838eb9..c1ed5383805e56d5a5538a46d45354f7a343c1bf 100644 --- a/src/MANYBODY/pair_comb.cpp +++ b/src/MANYBODY/pair_comb.cpp @@ -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 diff --git a/src/MANYBODY/pair_eam.cpp b/src/MANYBODY/pair_eam.cpp index 02c33f6b5ad4d44e33edd66fc188cd27638a3484..464d4249768cf7a4e4914b235bc3b0c8406f1fb8 100644 --- a/src/MANYBODY/pair_eam.cpp +++ b/src/MANYBODY/pair_eam.cpp @@ -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 diff --git a/src/MANYBODY/pair_eam_alloy.cpp b/src/MANYBODY/pair_eam_alloy.cpp index ab45bccb2d66123fffde1e5cc2e1637a26895c0d..894ab079220ef9e8458849eac7f7e594a7949c4b 100644 --- a/src/MANYBODY/pair_eam_alloy.cpp +++ b/src/MANYBODY/pair_eam_alloy.cpp @@ -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 diff --git a/src/MANYBODY/pair_eam_fs.cpp b/src/MANYBODY/pair_eam_fs.cpp index 15059ad39a819dc6f67ec2706cf4279f2475f789..332d78f2ce16608d8edb8a9901a32400ca9ce4ef 100644 --- a/src/MANYBODY/pair_eam_fs.cpp +++ b/src/MANYBODY/pair_eam_fs.cpp @@ -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 diff --git a/src/MANYBODY/pair_eim.cpp b/src/MANYBODY/pair_eim.cpp index c8e25c31c77d151120c6c76849f5cd1940897488..a7e4400ea3865ecc12d110b4e1e03010782799ed 100644 --- a/src/MANYBODY/pair_eim.cpp +++ b/src/MANYBODY/pair_eim.cpp @@ -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 diff --git a/src/MANYBODY/pair_sw.cpp b/src/MANYBODY/pair_sw.cpp index 6c22f645a3051fce88ede048d771d29c4ee6c87c..3f18b6ff3dcb52510f495d4b4ccbd92a3c510ee9 100755 --- a/src/MANYBODY/pair_sw.cpp +++ b/src/MANYBODY/pair_sw.cpp @@ -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]; } diff --git a/src/MANYBODY/pair_tersoff.cpp b/src/MANYBODY/pair_tersoff.cpp index f21ff4e918e25ee6a5191b5b91b8ed60a6cc2a04..4cdb13573576a77f7393965a78cb48e948e3cdec 100755 --- a/src/MANYBODY/pair_tersoff.cpp +++ b/src/MANYBODY/pair_tersoff.cpp @@ -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]; } diff --git a/src/MEAM/pair_meam.cpp b/src/MEAM/pair_meam.cpp index 2f89c0694ef9bcbbc5341fb021a84875c43170c4..e26ee6c1e06515938d5577ef0a37e9b20d6f0f6d 100644 --- a/src/MEAM/pair_meam.cpp +++ b/src/MEAM/pair_meam.cpp @@ -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]; diff --git a/src/MOLECULE/angle_hybrid.cpp b/src/MOLECULE/angle_hybrid.cpp index ba9ed9ee9614dd0ff0bb03317489d86bce6414cd..183366b63eb65a6f1b279cc76e6f5983a6df9fde 100644 --- a/src/MOLECULE/angle_hybrid.cpp +++ b/src/MOLECULE/angle_hybrid.cpp @@ -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; diff --git a/src/MOLECULE/atom_vec_angle.cpp b/src/MOLECULE/atom_vec_angle.cpp index 6b2adfbdfa9e81cffbdab5ea5cbaee887ca99d0b..54c5cc6746c5e99ebe07339e2965de5d14016237 100644 --- a/src/MOLECULE/atom_vec_angle.cpp +++ b/src/MOLECULE/atom_vec_angle.cpp @@ -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; diff --git a/src/MOLECULE/atom_vec_bond.cpp b/src/MOLECULE/atom_vec_bond.cpp index 451e6ff87c3760231838c7c4789ec016231a7655..5900aa460945f6f0519d97a29c9633400521c4f9 100644 --- a/src/MOLECULE/atom_vec_bond.cpp +++ b/src/MOLECULE/atom_vec_bond.cpp @@ -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; diff --git a/src/MOLECULE/atom_vec_full.cpp b/src/MOLECULE/atom_vec_full.cpp index 26b2e99f8211f005bf631778328f111af039715e..8261b4317e80840da45636124c461e417ff942f0 100644 --- a/src/MOLECULE/atom_vec_full.cpp +++ b/src/MOLECULE/atom_vec_full.cpp @@ -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; diff --git a/src/MOLECULE/atom_vec_molecular.cpp b/src/MOLECULE/atom_vec_molecular.cpp index ec039b7be2b57aaf22d88ff12515f1bb087b985c..84bfa9f27a02539472200bba16f5e276fd04f8ee 100644 --- a/src/MOLECULE/atom_vec_molecular.cpp +++ b/src/MOLECULE/atom_vec_molecular.cpp @@ -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; diff --git a/src/MOLECULE/dihedral_hybrid.cpp b/src/MOLECULE/dihedral_hybrid.cpp index dde226fae2429df51bd1edb911f5589aa9c643cd..4ca0fd99d685ae007d3fdeb525002cadb9426398 100644 --- a/src/MOLECULE/dihedral_hybrid.cpp +++ b/src/MOLECULE/dihedral_hybrid.cpp @@ -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; } diff --git a/src/MOLECULE/improper_hybrid.cpp b/src/MOLECULE/improper_hybrid.cpp index 4e83f8b5b72d85b74db5c9331f9bf2e0b0d37480..01b9fc7bc54e4868c55b42a36c4848e50444b338 100644 --- a/src/MOLECULE/improper_hybrid.cpp +++ b/src/MOLECULE/improper_hybrid.cpp @@ -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; } diff --git a/src/MOLECULE/pair_hbond_dreiding_lj.cpp b/src/MOLECULE/pair_hbond_dreiding_lj.cpp index c6d243837370dd068cf270b9ddc52a458730ad2a..b97e2969c1a1374eacd2d05b1c0f826aad750e6f 100644 --- a/src/MOLECULE/pair_hbond_dreiding_lj.cpp +++ b/src/MOLECULE/pair_hbond_dreiding_lj.cpp @@ -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]; diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp b/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp index 1326d3ecd372d29dccee81110da2599b78c6471f..b8f2ffa62dd12aab1ef6bb14834cb8d05f0ee602 100644 --- a/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp +++ b/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp @@ -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_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(setflag); + memory->destroy(cutsq); + + 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"); - - 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(cutsq,n+1,n+1,"pair:cutsq"); + + 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"); } /* ---------------------------------------------------------------------- diff --git a/src/PERI/atom_vec_peri.cpp b/src/PERI/atom_vec_peri.cpp index 23be75893a9b19747b8dc35793b0eaf12719982c..68110b329ce601aa8e73eba9d8018a39dee0154c 100644 --- a/src/PERI/atom_vec_peri.cpp +++ b/src/PERI/atom_vec_peri.cpp @@ -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; diff --git a/src/PERI/fix_peri_neigh.cpp b/src/PERI/fix_peri_neigh.cpp index 3178e31d3efe96c71d5618fbaa69db03255faafa..3b2cf8642dd3e5992b106a6865ff59ce0597dd41 100644 --- a/src/PERI/fix_peri_neigh.cpp +++ b/src/PERI/fix_peri_neigh.cpp @@ -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), diff --git a/src/PERI/pair_peri_lps.cpp b/src/PERI/pair_peri_lps.cpp index fc92015c16b51d51315cac0b0e4270bb62c2548a..db7d67791e56ef347620cb06233e49fcdb325fe7 100644 --- a/src/PERI/pair_peri_lps.cpp +++ b/src/PERI/pair_peri_lps.cpp @@ -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"); } /* ---------------------------------------------------------------------- diff --git a/src/PERI/pair_peri_pmb.cpp b/src/PERI/pair_peri_pmb.cpp index afb1f017a8599b0fefc63ea4f3e4ee010b9cc698..29739f5bd6d0bff0b9e3d917cf836e7b23d4da5d 100644 --- a/src/PERI/pair_peri_pmb.cpp +++ b/src/PERI/pair_peri_pmb.cpp @@ -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"); } /* ---------------------------------------------------------------------- diff --git a/src/POEMS/fix_poems.cpp b/src/POEMS/fix_poems.cpp index f4edb3f1cfc3905c8d10b8334caa2d7d125fee3c..b928dcfcf2b8ce28af250cc643b96292aded69f7 100644 --- a/src/POEMS/fix_poems.cpp +++ b/src/POEMS/fix_poems.cpp @@ -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"); - - sum = memory->create_2d_double_array(nbody,6,"poems:sum"); - all = memory->create_2d_double_array(nbody,6,"poems:all"); + 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"); + + 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_2d_double_array(sum); - memory->destroy_2d_double_array(all); + 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(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"); } /* ---------------------------------------------------------------------- diff --git a/src/REAX/pair_reax.cpp b/src/REAX/pair_reax.cpp index 5553293ccac9f937767e88583164f7920798eef2..73dd8de20d5252ab1fab6e6d44ad2bdddbb499b7 100644 --- a/src/REAX/pair_reax.cpp +++ b/src/REAX/pair_reax.cpp @@ -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++) diff --git a/src/REPLICA/fix_event.cpp b/src/REPLICA/fix_event.cpp index 0cbbb91e89e6dff60103556c469b795556e9329a..44818c9a385a1fd9dfe1b3005c29c7dc02f5fa11 100644 --- a/src/REPLICA/fix_event.cpp +++ b/src/REPLICA/fix_event.cpp @@ -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"); diff --git a/src/REPLICA/fix_neb.cpp b/src/REPLICA/fix_neb.cpp index 6d9074964f7800cc74c861487ab609ff8889ff7a..ad27e54dd99dcff7251dcffb3f12d44b931a8cc8 100644 --- a/src/REPLICA/fix_neb.cpp +++ b/src/REPLICA/fix_neb.cpp @@ -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"); } /* ---------------------------------------------------------------------- */ diff --git a/src/REPLICA/neb.cpp b/src/REPLICA/neb.cpp index a46f84d62218129fe2c4eae2322e0ed1dc9dd68f..4c4fc35633eda43c7d94d93a6af91555384eb116 100644 --- a/src/REPLICA/neb.cpp +++ b/src/REPLICA/neb.cpp @@ -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 diff --git a/src/REPLICA/prd.cpp b/src/REPLICA/prd.cpp index 84d711270580bb5b94ce8c3a60bdc38c9bc45269..c433370d7a6791074134b51d5b37b1336774e0fa 100644 --- a/src/REPLICA/prd.cpp +++ b/src/REPLICA/prd.cpp @@ -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); diff --git a/src/SRD/fix_srd.cpp b/src/SRD/fix_srd.cpp index d7ec560fa0c8eb8f9b7eadbd3f6d9a59f301c028..4892c424671fe5c8e8a4b690046be32a72c5aa34 100644 --- a/src/SRD/fix_srd.cpp +++ b/src/SRD/fix_srd.cpp @@ -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 diff --git a/src/SRD/fix_wall_srd.cpp b/src/SRD/fix_wall_srd.cpp index 9c8eb4ce5aa304e07d1525448b662aadafabfc16..2f18d288376f48aa545fa41b0605da6331fc78e5 100644 --- a/src/SRD/fix_wall_srd.cpp +++ b/src/SRD/fix_wall_srd.cpp @@ -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); } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-CG-CMM/pair_cg_cmm_coul_cut.cpp b/src/USER-CG-CMM/pair_cg_cmm_coul_cut.cpp index fa9a8d25cd57df34a0298d4ff36d6975f0f254d2..87b9db2ba87984dee5b45d4f80093fdb804c51ea 100644 --- a/src/USER-CG-CMM/pair_cg_cmm_coul_cut.cpp +++ b/src/USER-CG-CMM/pair_cg_cmm_coul_cut.cpp @@ -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"); } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-CG-CMM/pair_cg_cmm_coul_long.cpp b/src/USER-CG-CMM/pair_cg_cmm_coul_long.cpp index b001981f7dcddcbc84efe353f1e5b732662ae5b0..441528c8ff1ac97a7bb92fe3d759a4f0fd548f58 100644 --- a/src/USER-CG-CMM/pair_cg_cmm_coul_long.cpp +++ b/src/USER-CG-CMM/pair_cg_cmm_coul_long.cpp @@ -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"); } /* ---------------------------------------------------------------------- diff --git a/src/USER-CG-CMM/pair_cmm_common.cpp b/src/USER-CG-CMM/pair_cmm_common.cpp index 0198a09231908c2ea128da85ed99c0cae0d4094b..fb8bf72a8249634a270af80a574df415938a8db5 100644 --- a/src/USER-CG-CMM/pair_cmm_common.cpp +++ b/src/USER-CG-CMM/pair_cmm_common.cpp @@ -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"); } /* ---------------------------------------------------------------------- diff --git a/src/USER-EFF/atom_vec_electron.cpp b/src/USER-EFF/atom_vec_electron.cpp index c54fa8cbb46851bc1903ae77ef3da1bf934bc099..4c4e1d1c3a16e1d70921755bc65c4f98637355f6 100644 --- a/src/USER-EFF/atom_vec_electron.cpp +++ b/src/USER-EFF/atom_vec_electron.cpp @@ -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; diff --git a/src/USER-EFF/compute_temp_deform_eff.cpp b/src/USER-EFF/compute_temp_deform_eff.cpp index 5001e037732efc576a7e2039c11ed740d4b1b35c..41430e5b4e349e0835ae8a2c4452a0b8a6b344fc 100644 --- a/src/USER-EFF/compute_temp_deform_eff.cpp +++ b/src/USER-EFF/compute_temp_deform_eff.cpp @@ -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]; diff --git a/src/USER-EFF/compute_temp_region_eff.cpp b/src/USER-EFF/compute_temp_region_eff.cpp index 58af7098bee201000ecfc140437c01bef0dd9402..8b1ac402c7c1f665e44b9e0728c1f54e0204ae80 100644 --- a/src/USER-EFF/compute_temp_region_eff.cpp +++ b/src/USER-EFF/compute_temp_region_eff.cpp @@ -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]; diff --git a/src/USER-EFF/fix_langevin_eff.cpp b/src/USER-EFF/fix_langevin_eff.cpp index 45b9eba0f7d1e285f2533a717aaec3bb1e95cfce..81cfbbc589af823d213a55ace5619f4751ca5193 100644 --- a/src/USER-EFF/fix_langevin_eff.cpp +++ b/src/USER-EFF/fix_langevin_eff.cpp @@ -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"); } diff --git a/src/USER-EFF/pair_eff_cut.cpp b/src/USER-EFF/pair_eff_cut.cpp index fd60f675c647fe76ff30001ec86635539142c100..63ca79d3b6d48613dd9e5f71cee341eb38b70411 100644 --- a/src/USER-EFF/pair_eff_cut.cpp +++ b/src/USER-EFF/pair_eff_cut.cpp @@ -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"); } /* --------------------------------------------------------------------- diff --git a/src/USER-EWALDN/pair_buck_coul.cpp b/src/USER-EWALDN/pair_buck_coul.cpp index 4bb787257375828af09240fff38f7e504ca4f7b2..8909c19167aabc4f5c442a271bacddb9d20b90db 100644 --- a/src/USER-EWALDN/pair_buck_coul.cpp +++ b/src/USER-EWALDN/pair_buck_coul.cpp @@ -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_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(setflag); + memory->destroy(cutsq); + + 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"); - - 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(cutsq,n+1,n+1,"pair:cutsq"); + + 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"); } /* ---------------------------------------------------------------------- diff --git a/src/USER-EWALDN/pair_lj_coul.cpp b/src/USER-EWALDN/pair_lj_coul.cpp index d2b84beb26f02fd93c734988c97d994bd61ee6cb..0a5190525cf85ae78688f5b9fdd2eb1de3e7ba43 100644 --- a/src/USER-EWALDN/pair_lj_coul.cpp +++ b/src/USER-EWALDN/pair_lj_coul.cpp @@ -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_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(setflag); + memory->destroy(cutsq); + + 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"); - - 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(cutsq,n+1,n+1,"pair:cutsq"); + + 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"); } /* ---------------------------------------------------------------------- diff --git a/src/USER-REAXC/fix_qeq_reax.cpp b/src/USER-REAXC/fix_qeq_reax.cpp index 640f10245904b7c4b3afa89ab8c815789ff0147a..913919f558b10535c70580c8d7f55fa70166363d 100644 --- a/src/USER-REAXC/fix_qeq_reax.cpp +++ b/src/USER-REAXC/fix_qeq_reax.cpp @@ -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"); } /* ---------------------------------------------------------------------- diff --git a/src/USER-REAXC/pair_reax_c.cpp b/src/USER-REAXC/pair_reax_c.cpp index f30a82873f3eef1803995a654731e3ff6a8ce503..340cf804cf38d4a028d7f9baedd069b19268b3fc 100644 --- a/src/USER-REAXC/pair_reax_c.cpp +++ b/src/USER-REAXC/pair_reax_c.cpp @@ -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]; diff --git a/src/angle.cpp b/src/angle.cpp index df8a80e22f8af11cfac5cbde63291e70896db8ff..2884dd7ac4b057bfce5b63f91016763504d8f888 100644 --- a/src/angle.cpp +++ b/src/angle.cpp @@ -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 diff --git a/src/atom_vec_atomic.cpp b/src/atom_vec_atomic.cpp index 9a814dda8228a90bc2a21b3ce2cdd940c76f6551..0b5d36d15c7fecc3f12097fd70279d2265ffa05a 100644 --- a/src/atom_vec_atomic.cpp +++ b/src/atom_vec_atomic.cpp @@ -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; diff --git a/src/atom_vec_charge.cpp b/src/atom_vec_charge.cpp index 85ff93d2b083730d37d24cd0cda4d1526930de24..e2f6ac4c03de3cfa06d28d880ff972924c01aa1c 100644 --- a/src/atom_vec_charge.cpp +++ b/src/atom_vec_charge.cpp @@ -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; diff --git a/src/atom_vec_hybrid.cpp b/src/atom_vec_hybrid.cpp index 3e2cdac6566b2e1ba33d360df367fe7879bd2651..0a64c99ba23413ad1c2e2be96a39d256ea29b192 100644 --- a/src/atom_vec_hybrid.cpp +++ b/src/atom_vec_hybrid.cpp @@ -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; diff --git a/src/bond.cpp b/src/bond.cpp index 6551297f46e12b897eee8289e541cc465a43e1ba..e30ebdc73d3a649193203561fc66273de7dda834 100644 --- a/src/bond.cpp +++ b/src/bond.cpp @@ -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 diff --git a/src/bond_hybrid.cpp b/src/bond_hybrid.cpp index a373248dad242769f74118da84b670e6f0f8b8ff..d177f716c26c88d369d5da7f89895e436be4420b 100644 --- a/src/bond_hybrid.cpp +++ b/src/bond_hybrid.cpp @@ -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; diff --git a/src/compute_angle_local.cpp b/src/compute_angle_local.cpp index b03bf40045d7bc4978eaf5dc8d30539a28376393..7a7ebf978b5276e19961b4c7eb92d915a8f32bfc 100644 --- a/src/compute_angle_local.cpp +++ b/src/compute_angle_local.cpp @@ -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; } } diff --git a/src/compute_atom_molecule.cpp b/src/compute_atom_molecule.cpp index 5972da184e4aa17c8b869ee338cc2a4afb993df4..00fb93295bc12d2ecb756291865e1c4cf64261d9 100644 --- a/src/compute_atom_molecule.cpp +++ b/src/compute_atom_molecule.cpp @@ -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); } diff --git a/src/compute_bond_local.cpp b/src/compute_bond_local.cpp index 379ee5662fcca91cb1c0c237fe6b7adca982d8b8..c012bed3a6e739a43e2103d11ab85f171e81e610 100644 --- a/src/compute_bond_local.cpp +++ b/src/compute_bond_local.cpp @@ -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; } } diff --git a/src/compute_cna_atom.cpp b/src/compute_cna_atom.cpp index 4416671d5cf11f3719de19d11ba45a81efe757f3..0e8df48723fd8a277870be95dc90c90713f79fed 100644 --- a/src/compute_cna_atom.cpp +++ b/src/compute_cna_atom.cpp @@ -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"); diff --git a/src/compute_com_molecule.cpp b/src/compute_com_molecule.cpp index 33236924696f69df023080b8de2181d7fe485908..235e6c3c258dc6a51c868cf6f93737048d874df5 100644 --- a/src/compute_com_molecule.cpp +++ b/src/compute_com_molecule.cpp @@ -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); } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_dihedral_local.cpp b/src/compute_dihedral_local.cpp index a8f2eddc50412e950d904074ba4ca1f5f87013b3..94563588e8be1e422dbb4f27b1ce934119e58db8 100644 --- a/src/compute_dihedral_local.cpp +++ b/src/compute_dihedral_local.cpp @@ -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; } } diff --git a/src/compute_displace_atom.cpp b/src/compute_displace_atom.cpp index 9c5112c9449124662728ce3bda496d747bd46d29..fbd828be5ddeaa284d431ad349ff5da3d3d776d9 100644 --- a/src/compute_displace_atom.cpp +++ b/src/compute_displace_atom.cpp @@ -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; } diff --git a/src/compute_gyration_molecule.cpp b/src/compute_gyration_molecule.cpp index e5dfee99663bd04ee52920ed5a6659c47aad1819..d0dd1b77b6f7c310e5aaa36d0d4b86b174dd3277 100644 --- a/src/compute_gyration_molecule.cpp +++ b/src/compute_gyration_molecule.cpp @@ -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); } diff --git a/src/compute_improper_local.cpp b/src/compute_improper_local.cpp index 00153b66ac2a29e552c22366015e16feaa617e0a..0f22206b4205996cb4b56e8efc6e354677624449 100644 --- a/src/compute_improper_local.cpp +++ b/src/compute_improper_local.cpp @@ -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; } } diff --git a/src/compute_msd_molecule.cpp b/src/compute_msd_molecule.cpp index ca9f099ff1430a37ce29b3e10d4889caf2cece38..7f49857719a82bd3b42f2e1034a52f2eb6f4a731 100644 --- a/src/compute_msd_molecule.cpp +++ b/src/compute_msd_molecule.cpp @@ -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); } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_pair_local.cpp b/src/compute_pair_local.cpp index cbb779b6c17f6f85158cc791a6ca3e1116d0eb80..53f21ae74232480937eebb89842007b461ebcec0 100644 --- a/src/compute_pair_local.cpp +++ b/src/compute_pair_local.cpp @@ -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; } } diff --git a/src/compute_property_atom.cpp b/src/compute_property_atom.cpp index 4447d9f06fe85b2d37ac159fbdadcdc8de6b6489..1e2137e1710870fcb363e719668b3af5b2e836bf 100644 --- a/src/compute_property_atom.cpp +++ b/src/compute_property_atom.cpp @@ -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; } } diff --git a/src/compute_property_local.cpp b/src/compute_property_local.cpp index d7c814eafb04e4658fa47be0e67e156f87ac2611..745a09af5e8003be397d32038ce62b692a406e0c 100644 --- a/src/compute_property_local.cpp +++ b/src/compute_property_local.cpp @@ -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"); } /* ---------------------------------------------------------------------- diff --git a/src/compute_property_molecule.cpp b/src/compute_property_molecule.cpp index 16c30ab855898fd96dd7d5acf5554b14f793d51e..de73b3b52f57d0d2504cf642a70bf05cb33b97d8 100644 --- a/src/compute_property_molecule.cpp +++ b/src/compute_property_molecule.cpp @@ -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); } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_rdf.cpp b/src/compute_rdf.cpp index c4fef5a6b38c1670d6cd2159c77d63acdd571222..04848b39231628ee305f2506b32083d48d58f9ef 100644 --- a/src/compute_rdf.cpp +++ b/src/compute_rdf.cpp @@ -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; diff --git a/src/compute_stress_atom.cpp b/src/compute_stress_atom.cpp index 62d7799f13ba38d1adea0c1fcdd7b46b7d70c613..b17d4fc6a223a967395faa3bf208bb6396ca9178 100644 --- a/src/compute_stress_atom.cpp +++ b/src/compute_stress_atom.cpp @@ -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; } diff --git a/src/compute_temp_deform.cpp b/src/compute_temp_deform.cpp index a03e74e85e11934c427feee0928cf700418ee67f..665f904fdb1ec024245fe8afb7248db1da5f1bdf 100644 --- a/src/compute_temp_deform.cpp +++ b/src/compute_temp_deform.cpp @@ -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]; diff --git a/src/compute_temp_partial.cpp b/src/compute_temp_partial.cpp index 648059319193db8bc9a6b180d874d67c1e5e1f48..96fd04037c24b6fff3d1fb610e8970f8600b9eb9 100644 --- a/src/compute_temp_partial.cpp +++ b/src/compute_temp_partial.cpp @@ -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) { diff --git a/src/compute_temp_profile.cpp b/src/compute_temp_profile.cpp index 6d3bb452a44b07ee2819062a163deda02e2b67bb..f15089c833209474c39fbe89842dfa6701e6d5ae 100644 --- a/src/compute_temp_profile.cpp +++ b/src/compute_temp_profile.cpp @@ -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; diff --git a/src/compute_temp_ramp.cpp b/src/compute_temp_ramp.cpp index b9e6cdff9aa7060e6060b4c8b108dd0cb22f6474..1690e1224c2bf32060866f9a9e42a903e266c6cc 100644 --- a/src/compute_temp_ramp.cpp +++ b/src/compute_temp_ramp.cpp @@ -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; diff --git a/src/compute_temp_region.cpp b/src/compute_temp_region.cpp index c297b85d95b192f3989fe539fc47b89aa14a0ebe..b43af45de348fb8402e93ace6febf9ebe1fcb60e 100644 --- a/src/compute_temp_region.cpp +++ b/src/compute_temp_region.cpp @@ -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]; diff --git a/src/dihedral.cpp b/src/dihedral.cpp index 8f8c700e08eec00de124d347c4e8b9c5b6d77739..0adfd295e0b549fdd8180182e9134c5010311a80 100644 --- a/src/dihedral.cpp +++ b/src/dihedral.cpp @@ -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 diff --git a/src/dump_cfg.cpp b/src/dump_cfg.cpp index 1635252f183d0c185aba6ec779f6b4fb8672898b..4580e4ad6da6b571b5be5cecd03df902f2de3fac 100755 --- a/src/dump_cfg.cpp +++ b/src/dump_cfg.cpp @@ -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"); } } diff --git a/src/fix.cpp b/src/fix.cpp index 2466be2d9f9d1dc71748e84bce20ae3732c28238..e2c077fbc49074542bc811a2b73591b15e9a8333 100644 --- a/src/fix.cpp +++ b/src/fix.cpp @@ -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 diff --git a/src/fix_adapt.cpp b/src/fix_adapt.cpp index ac7797207ea57541b5f59047971156daca3658ff..7fb769df907da82e5852dd35f32c2f17c4c70be5 100644 --- a/src/fix_adapt.cpp +++ b/src/fix_adapt.cpp @@ -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; diff --git a/src/fix_addforce.cpp b/src/fix_addforce.cpp index b51b2dcc0de84e1cc81192d75b1f0bda9ead64db..34f9adb166c7bfd4870e4c8b3c92b0e4b31f1b31 100644 --- a/src/fix_addforce.cpp +++ b/src/fix_addforce.cpp @@ -114,7 +114,7 @@ FixAddForce::~FixAddForce() delete [] zstr; delete [] estr; delete [] idregion; - memory->destroy_2d_double_array(sforce); + memory->destroy(sforce); } /* ---------------------------------------------------------------------- */ @@ -220,8 +220,8 @@ void FixAddForce::post_force(int vflag) if ((varflag == ATOM || estyle == ATOM) && nlocal > maxatom) { maxatom = atom->nmax; - memory->destroy_2d_double_array(sforce); - sforce = memory->create_2d_double_array(maxatom,4,"addforce:sforce"); + memory->destroy(sforce); + memory->create(sforce,maxatom,4,"addforce:sforce"); } // foriginal[0] = "potential energy" for added force diff --git a/src/fix_ave_atom.cpp b/src/fix_ave_atom.cpp index cde0a62f615749a04f9ff63bf92a2683099c87a3..d69edf87a2db47d8a074ee68e32a8958a3ec03f1 100644 --- a/src/fix_ave_atom.cpp +++ b/src/fix_ave_atom.cpp @@ -211,7 +211,7 @@ FixAveAtom::~FixAveAtom() delete [] ids; delete [] value2index; - memory->destroy_2d_double_array(array); + memory->destroy(array); } /* ---------------------------------------------------------------------- */ @@ -394,8 +394,7 @@ double FixAveAtom::memory_usage() void FixAveAtom::grow_arrays(int nmax) { - array = memory->grow_2d_double_array(array,nmax,nvalues, - "fix_ave/atom:array"); + memory->grow(array,nmax,nvalues,"fix_ave/atom:array"); array_atom = array; if (array) vector_atom = array[0]; else vector_atom = NULL; diff --git a/src/fix_ave_correlate.cpp b/src/fix_ave_correlate.cpp index 4660662e04d1de24c21d2ad3747e1d878a55e58d..4fedfc6a74981f02fe7d89c9b73af62cf18384ac 100644 --- a/src/fix_ave_correlate.cpp +++ b/src/fix_ave_correlate.cpp @@ -263,16 +263,13 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg): // set count and corr to zero since they accumulate // also set save versions to zero in case accessed via compute_array() - values = memory->create_2d_double_array(nrepeat,nvalues, - "ave/correlate:values"); + memory->create(values,nrepeat,nvalues,"ave/correlate:values"); count = (int *) memory->smalloc(nrepeat*sizeof(int), "ave/correlate:count"); save_count = (int *) memory->smalloc(nrepeat*sizeof(int), "ave/correlate:save_count"); - corr = memory->create_2d_double_array(nrepeat,npair, - "ave/correlate:corr"); - save_corr = memory->create_2d_double_array(nrepeat,npair, - "ave/correlate:save_corr"); + memory->create(corr,nrepeat,npair,"ave/correlate:corr"); + memory->create(save_corr,nrepeat,npair,"ave/correlate:save_corr"); int i,j; for (i = 0; i < nrepeat; i++) { @@ -310,11 +307,11 @@ FixAveCorrelate::~FixAveCorrelate() for (int i = 0; i < nvalues; i++) delete [] ids[i]; delete [] ids; - memory->destroy_2d_double_array(values); + memory->destroy(values); memory->sfree(count); memory->sfree(save_count); - memory->destroy_2d_double_array(corr); - memory->destroy_2d_double_array(save_corr); + memory->destroy(corr); + memory->destroy(save_corr); if (fp && me == 0) fclose(fp); } diff --git a/src/fix_ave_histo.cpp b/src/fix_ave_histo.cpp index b5f94b3e7b2a02d78b9ce0dfc61eeb73059e9a1b..ce9eac48482032fa6eac539907db1b664bb80816 100644 --- a/src/fix_ave_histo.cpp +++ b/src/fix_ave_histo.cpp @@ -444,10 +444,8 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : vector = NULL; maxatom = 0; if (ave == WINDOW) { - stats_list = memory->create_2d_double_array(nwindow,4, - "ave/histo:stats_list"); - bin_list = memory->create_2d_double_array(nwindow,nbins, - "ave/histo:bin_list"); + memory->create(stats_list,nwindow,4,"histo:stats_list"); + memory->create(bin_list,nwindow,nbins,"ave/histo:bin_list"); } // initializations @@ -502,8 +500,8 @@ FixAveHisto::~FixAveHisto() delete [] bin_total; delete [] bin_all; delete [] coord; - memory->destroy_2d_double_array(stats_list); - memory->destroy_2d_double_array(bin_list); + memory->destroy(stats_list); + memory->destroy(bin_list); memory->sfree(vector); } diff --git a/src/fix_ave_spatial.cpp b/src/fix_ave_spatial.cpp index 0bb843de25d5fb283e923668bda35f2b5225bc44..52f668681597980d231e550e0ab3c01600ef227d 100644 --- a/src/fix_ave_spatial.cpp +++ b/src/fix_ave_spatial.cpp @@ -401,12 +401,12 @@ FixAveSpatial::~FixAveSpatial() memory->sfree(count_many); memory->sfree(count_sum); memory->sfree(count_total); - memory->destroy_2d_double_array(coord); - memory->destroy_2d_double_array(count_list); - memory->destroy_2d_double_array(values_one); - memory->destroy_2d_double_array(values_many); - memory->destroy_2d_double_array(values_sum); - memory->destroy_2d_double_array(values_total); + memory->destroy(coord); + memory->destroy(count_list); + memory->destroy(values_one); + memory->destroy(values_many); + memory->destroy(values_sum); + memory->destroy(values_total); memory->destroy(values_list); } @@ -895,23 +895,16 @@ void FixAveSpatial::setup_bins() memory->srealloc(count_total,nbins*sizeof(double), "ave/spatial:count_total"); - coord = - memory->grow_2d_double_array(coord,nbins,ndim,"ave/spatial:coord"); - values_one = memory->grow_2d_double_array(values_one,nbins,nvalues, - "ave/spatial:values_one"); - values_many = memory->grow_2d_double_array(values_many,nbins,nvalues, - "ave/spatial:values_many"); - values_sum = memory->grow_2d_double_array(values_sum,nbins,nvalues, - "ave/spatial:values_sum"); - values_total = memory->grow_2d_double_array(values_total,nbins,nvalues, - "ave/spatial:values_total"); + memory->grow(coord,nbins,ndim,"ave/spatial:coord"); + memory->grow(values_one,nbins,nvalues,"ave/spatial:values_one"); + memory->grow(values_many,nbins,nvalues,"ave/spatial:values_many"); + memory->grow(values_sum,nbins,nvalues,"ave/spatial:values_sum"); + memory->grow(values_total,nbins,nvalues,"ave/spatial:values_total"); // only allocate count and values list for ave = WINDOW if (ave == WINDOW) { - count_list = - memory->create_2d_double_array(nwindow,nbins, - "ave/spatial:count_list"); + memory->create(count_list,nwindow,nbins,"ave/spatial:count_list"); memory->create(values_list,nwindow,nbins,nvalues, "ave/spatial:values_list"); } diff --git a/src/fix_ave_time.cpp b/src/fix_ave_time.cpp index 5b852750cf9276e4dd0eac3f0077847a77bc18af..aaeb4b543c6f9e761180d91eaab75b1f592e972a 100644 --- a/src/fix_ave_time.cpp +++ b/src/fix_ave_time.cpp @@ -297,12 +297,10 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : vector = new double[nvalues]; vector_total = new double[nvalues]; if (ave == WINDOW) - vector_list = memory->create_2d_double_array(nwindow,nvalues, - "ave/time:vector_list"); + memory->create(vector_list,nwindow,nvalues,"ave/time:vector_list"); } else { - array = memory->create_2d_double_array(nrows,nvalues,"ave/time:array"); - array_total = memory->create_2d_double_array(nrows,nvalues, - "ave/time:array_total"); + memory->create(array,nrows,nvalues,"ave/time:array"); + memory->create(array_total,nrows,nvalues,"ave/time:array_total"); if (ave == WINDOW) memory->create(array_list,nwindow,nrows,nvalues,"ave/time:array_list"); } @@ -441,8 +439,8 @@ FixAveTime::~FixAveTime() delete [] vector; delete [] vector_total; delete [] column; - memory->destroy_2d_double_array(array); - memory->destroy_2d_double_array(array_total); + memory->destroy(array); + memory->destroy(array_total); memory->destroy(array_list); } diff --git a/src/fix_efield.cpp b/src/fix_efield.cpp index 90bf8cbacc688eec02880f9c6eec8613f6ecd749..78eca23a810130d7c9f7479432b1e633df73036a 100644 --- a/src/fix_efield.cpp +++ b/src/fix_efield.cpp @@ -81,7 +81,7 @@ FixEfield::~FixEfield() delete [] xstr; delete [] ystr; delete [] zstr; - memory->destroy_2d_double_array(efield); + memory->destroy(efield); } /* ---------------------------------------------------------------------- */ @@ -162,8 +162,8 @@ void FixEfield::post_force(int vflag) if (varflag == ATOM && nlocal > maxatom) { maxatom = atom->nmax; - memory->destroy_2d_double_array(efield); - efield = memory->create_2d_double_array(maxatom,3,"efield:efield"); + memory->destroy(efield); + memory->create(efield,maxatom,3,"efield:efield"); } if (varflag == CONSTANT) { diff --git a/src/fix_external.cpp b/src/fix_external.cpp index 3bbc92fda68cf7f4f004d519bd6514b46f0120fe..449a6d07c990ba4401618a57757bf062a2e0fe11 100644 --- a/src/fix_external.cpp +++ b/src/fix_external.cpp @@ -38,7 +38,7 @@ FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) : FixExternal::~FixExternal() { - memory->destroy_2d_double_array(fexternal); + memory->destroy(fexternal); } /* ---------------------------------------------------------------------- */ @@ -77,9 +77,9 @@ void FixExternal::min_setup(int vflag) void FixExternal::post_force(int vflag) { if (atom->nlocal > nmax) { - memory->destroy_2d_double_array(fexternal); + memory->destroy(fexternal); nmax = atom->nmax; - fexternal = memory->create_2d_double_array(nmax,3,"external:fexternal"); + memory->create(fexternal,nmax,3,"external:fexternal"); } // invoke the callback in driver program diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp index 7c7e157d26efad88f7f5403c94c6af75b3f960a6..ae2cb4f2e57677021268dbebfc52bcb1b7ffde1b 100644 --- a/src/fix_langevin.cpp +++ b/src/fix_langevin.cpp @@ -113,7 +113,7 @@ FixLangevin::~FixLangevin() delete [] gfactor2; delete [] ratio; delete [] id_temp; - memory->destroy_2d_double_array(flangevin); + memory->destroy(flangevin); } /* ---------------------------------------------------------------------- */ @@ -285,9 +285,9 @@ void FixLangevin::post_force_tally() // reallocate flangevin if necessary if (atom->nmax > nmax) { - memory->destroy_2d_double_array(flangevin); + memory->destroy(flangevin); nmax = atom->nmax; - flangevin = memory->create_2d_double_array(nmax,3,"langevin:flangevin"); + memory->create(flangevin,nmax,3,"langevin:flangevin"); } double **v = atom->v; diff --git a/src/fix_move.cpp b/src/fix_move.cpp index 43f5df7d24a47d821c3fa64b7f8299eeed441b35..5108793cf514db1a988c87dde94f5ccc88329c29 100644 --- a/src/fix_move.cpp +++ b/src/fix_move.cpp @@ -273,9 +273,9 @@ FixMove::~FixMove() // delete locally stored arrays - memory->destroy_2d_double_array(xoriginal); - memory->destroy_2d_double_array(displace); - memory->destroy_2d_double_array(velocity); + memory->destroy(xoriginal); + memory->destroy(displace); + memory->destroy(velocity); delete [] xvarstr; delete [] yvarstr; @@ -561,12 +561,12 @@ void FixMove::initial_integrate(int vflag) if ((displaceflag || velocityflag) && nlocal > maxatom) { maxatom = atom->nmax; if (displaceflag) { - memory->destroy_2d_double_array(displace); - displace = memory->create_2d_double_array(maxatom,3,"move:displace"); + memory->destroy(displace); + memory->create(displace,maxatom,3,"move:displace"); } if (velocityflag) { - memory->destroy_2d_double_array(velocity); - velocity = memory->create_2d_double_array(maxatom,3,"move:velocity"); + memory->destroy(velocity); + memory->create(velocity,maxatom,3,"move:velocity"); } } @@ -843,8 +843,7 @@ void FixMove::restart(char *buf) void FixMove::grow_arrays(int nmax) { - xoriginal = - memory->grow_2d_double_array(xoriginal,nmax,3,"move:xoriginal"); + memory->grow(xoriginal,nmax,3,"move:xoriginal"); array_atom = xoriginal; } diff --git a/src/fix_orient_fcc.cpp b/src/fix_orient_fcc.cpp index c7b891ee9976d26436d66518d270cbf888362941..a64acd73a570dae434f461758f13a13f6f968b1d 100644 --- a/src/fix_orient_fcc.cpp +++ b/src/fix_orient_fcc.cpp @@ -159,7 +159,7 @@ FixOrientFCC::FixOrientFCC(LAMMPS *lmp, int narg, char **arg) : nmax = atom->nmax; nbr = (Nbr *) memory->smalloc(nmax*sizeof(Nbr),"orient/fcc:nbr"); - order = memory->create_2d_double_array(nmax,2,"orient/fcc:order"); + memory->create(order,nmax,2,"orient/fcc:order"); array_atom = order; // zero the array since a variable may access it before first run @@ -175,7 +175,7 @@ FixOrientFCC::~FixOrientFCC() delete [] xifilename; delete [] chifilename; memory->sfree(nbr); - memory->destroy_2d_double_array(order); + memory->destroy(order); } /* ---------------------------------------------------------------------- */ @@ -256,9 +256,9 @@ void FixOrientFCC::post_force(int vflag) if (nall > nmax) { nmax = nall; memory->sfree(nbr); - memory->destroy_2d_double_array(order); + memory->destroy(order); nbr = (Nbr *) memory->smalloc(nmax*sizeof(Nbr),"orient/fcc:nbr"); - order = memory->create_2d_double_array(nmax,2,"orient/fcc:order"); + memory->create(order,nmax,2,"orient/fcc:order"); array_atom = order; } diff --git a/src/fix_read_restart.cpp b/src/fix_read_restart.cpp index 3ed607d6835a100e528e5d4922313e658771b7ec..f0a154578b4ffa5bcbb571236bd5945b3cdc3ed5 100644 --- a/src/fix_read_restart.cpp +++ b/src/fix_read_restart.cpp @@ -59,7 +59,7 @@ FixReadRestart::~FixReadRestart() // delete locally stored arrays memory->sfree(count); - memory->destroy_2d_double_array(extra); + memory->destroy(extra); } /* ---------------------------------------------------------------------- */ @@ -89,8 +89,7 @@ void FixReadRestart::grow_arrays(int nmax) { count = (int *) memory->srealloc(count,nmax*sizeof(int),"read_restart:count"); - extra = - memory->grow_2d_double_array(extra,nmax,nextra,"read_restart:extra"); + memory->grow(extra,nmax,nextra,"read_restart:extra"); } /* ---------------------------------------------------------------------- diff --git a/src/fix_rigid.cpp b/src/fix_rigid.cpp index 6a78eedd9a736a25c32b7226b343af1874c0a63d..3003ae7774d7dc3e0d725891383867fcf29d586a 100644 --- a/src/fix_rigid.cpp +++ b/src/fix_rigid.cpp @@ -181,24 +181,24 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : nrigid = (int *) memory->smalloc(nbody*sizeof(int),"rigid:nrigid"); masstotal = (double *) memory->smalloc(nbody*sizeof(double),"rigid:masstotal"); - xcm = memory->create_2d_double_array(nbody,3,"rigid:xcm"); - vcm = memory->create_2d_double_array(nbody,3,"rigid:vcm"); - fcm = memory->create_2d_double_array(nbody,3,"rigid:fcm"); - inertia = memory->create_2d_double_array(nbody,3,"rigid:inertia"); - ex_space = memory->create_2d_double_array(nbody,3,"rigid:ex_space"); - ey_space = memory->create_2d_double_array(nbody,3,"rigid:ey_space"); - ez_space = memory->create_2d_double_array(nbody,3,"rigid:ez_space"); - angmom = memory->create_2d_double_array(nbody,3,"rigid:angmom"); - omega = memory->create_2d_double_array(nbody,3,"rigid:omega"); - torque = memory->create_2d_double_array(nbody,3,"rigid:torque"); - quat = memory->create_2d_double_array(nbody,4,"rigid:quat"); + memory->create(xcm,nbody,3,"rigid:xcm"); + memory->create(vcm,nbody,3,"rigid:vcm"); + memory->create(fcm,nbody,3,"rigid:fcm"); + memory->create(inertia,nbody,3,"rigid:inertia"); + memory->create(ex_space,nbody,3,"rigid:ex_space"); + memory->create(ey_space,nbody,3,"rigid:ey_space"); + memory->create(ez_space,nbody,3,"rigid:ez_space"); + memory->create(angmom,nbody,3,"rigid:angmom"); + memory->create(omega,nbody,3,"rigid:omega"); + memory->create(torque,nbody,3,"rigid:torque"); + memory->create(quat,nbody,4,"rigid:quat"); imagebody = (int *) memory->smalloc(nbody*sizeof(int),"rigid:imagebody"); - fflag = memory->create_2d_double_array(nbody,3,"rigid:fflag"); - tflag = memory->create_2d_double_array(nbody,3,"rigid:tflag"); + memory->create(fflag,nbody,3,"rigid:fflag"); + memory->create(tflag,nbody,3,"rigid:tflag"); - sum = memory->create_2d_double_array(nbody,6,"rigid:sum"); - all = memory->create_2d_double_array(nbody,6,"rigid:all"); - remapflag = memory->create_2d_int_array(nbody,4,"rigid:remapflag"); + memory->create(sum,nbody,6,"rigid:sum"); + memory->create(all,nbody,6,"rigid:all"); + memory->create(remapflag,nbody,4,"rigid:remapflag"); // initialize force/torque flags to default = 1.0 @@ -384,33 +384,33 @@ FixRigid::~FixRigid() // delete locally stored arrays memory->sfree(body); - memory->destroy_2d_double_array(displace); + memory->destroy(displace); memory->sfree(eflags); - memory->destroy_2d_double_array(dorient); - memory->destroy_2d_double_array(qorient); + memory->destroy(dorient); + memory->destroy(qorient); // delete nbody-length arrays memory->sfree(nrigid); memory->sfree(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_2d_double_array(quat); + 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(quat); memory->sfree(imagebody); - memory->destroy_2d_double_array(fflag); - memory->destroy_2d_double_array(tflag); + memory->destroy(fflag); + memory->destroy(tflag); - memory->destroy_2d_double_array(sum); - memory->destroy_2d_double_array(all); - memory->destroy_2d_int_array(remapflag); + memory->destroy(sum); + memory->destroy(all); + memory->destroy(remapflag); } /* ---------------------------------------------------------------------- */ @@ -693,8 +693,9 @@ void FixRigid::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; @@ -756,8 +757,8 @@ void FixRigid::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 // set displace = 0.0 for atoms not in any rigid body @@ -2156,14 +2157,12 @@ double FixRigid::memory_usage() void FixRigid::grow_arrays(int nmax) { body = (int *) memory->srealloc(body,nmax*sizeof(int),"rigid:body"); - displace = memory->grow_2d_double_array(displace,nmax,3,"rigid:displace"); + memory->grow(displace,nmax,3,"rigid:displace"); if (extended) { eflags = (int *) memory->srealloc(eflags,nmax*sizeof(int),"rigid:eflags"); - if (dorientflag) - dorient = memory->grow_2d_double_array(dorient,nmax,3,"rigid:dorient"); - if (qorientflag) - qorient = memory->grow_2d_double_array(qorient,nmax,4,"rigid:qorient"); + if (dorientflag) memory->grow(dorient,nmax,3,"rigid:dorient"); + if (qorientflag) memory->grow(qorient,nmax,4,"rigid:qorient"); } } diff --git a/src/fix_rigid_nve.cpp b/src/fix_rigid_nve.cpp index e5a06a89baa563d88935cf36b97137e75c847b08..f99a20ff7197e4dba516ddd664bb822452d4a387 100644 --- a/src/fix_rigid_nve.cpp +++ b/src/fix_rigid_nve.cpp @@ -39,14 +39,14 @@ using namespace LAMMPS_NS; FixRigidNVE::FixRigidNVE(LAMMPS *lmp, int narg, char **arg) : FixRigid(lmp, narg, arg) { - conjqm = memory->create_2d_double_array(nbody,4,"rigid/nve:conjqm"); + memory->create(conjqm,nbody,4,"rigid/nve:conjqm"); } /* ---------------------------------------------------------------------- */ FixRigidNVE::~FixRigidNVE() { - memory->destroy_2d_double_array(conjqm); + memory->destroy(conjqm); } /* ---------------------------------------------------------------------- */ diff --git a/src/fix_rigid_nvt.cpp b/src/fix_rigid_nvt.cpp index 0f16ca1980bd7233f995a7b41025a889a0cc63d9..34f83de9ee65b2e45c9db3e339e504f2314bb9ee 100644 --- a/src/fix_rigid_nvt.cpp +++ b/src/fix_rigid_nvt.cpp @@ -63,7 +63,7 @@ FixRigidNVT::FixRigidNVT(LAMMPS *lmp, int narg, char **arg) : allocate_chain(); allocate_order(); - conjqm = memory->create_2d_double_array(nbody,4,"nve_rigid:conjqm"); + memory->create(conjqm,nbody,4,"nve_rigid:conjqm"); // one-time initialize of thermostat variables @@ -83,7 +83,7 @@ FixRigidNVT::~FixRigidNVT() { deallocate_chain(); deallocate_order(); - memory->destroy_2d_double_array(conjqm); + memory->destroy(conjqm); } /* ---------------------------------------------------------------------- */ diff --git a/src/fix_setforce.cpp b/src/fix_setforce.cpp index 0f137e87dbedad1e47e358e378f06758232e7f72..18ab22ae7d319aaa2f686aa6665d784a31785a44 100644 --- a/src/fix_setforce.cpp +++ b/src/fix_setforce.cpp @@ -108,7 +108,7 @@ FixSetForce::~FixSetForce() delete [] ystr; delete [] zstr; delete [] idregion; - memory->destroy_2d_double_array(sforce); + memory->destroy(sforce); } /* ---------------------------------------------------------------------- */ @@ -216,8 +216,8 @@ void FixSetForce::post_force(int vflag) if (varflag == ATOM && nlocal > maxatom) { maxatom = atom->nmax; - memory->destroy_2d_double_array(sforce); - sforce = memory->create_2d_double_array(maxatom,3,"setforce:sforce"); + memory->destroy(sforce); + memory->create(sforce,maxatom,3,"setforce:sforce"); } foriginal[0] = foriginal[1] = foriginal[2] = 0.0; diff --git a/src/fix_shake.cpp b/src/fix_shake.cpp index 83ff409112bf508fcc180d73f461caa2f78b5075..5925231173046ec6f80f51a4fbe8a36f3b12f850 100644 --- a/src/fix_shake.cpp +++ b/src/fix_shake.cpp @@ -219,9 +219,9 @@ FixShake::~FixShake() // delete locally stored arrays memory->sfree(shake_flag); - memory->destroy_2d_int_array(shake_atom); - memory->destroy_2d_int_array(shake_type); - memory->destroy_2d_double_array(xshake); + memory->destroy(shake_atom); + memory->destroy(shake_type); + memory->destroy(xshake); delete [] bond_flag; delete [] angle_flag; @@ -659,20 +659,15 @@ void FixShake::find_clusters() memory->smalloc(nlocal*sizeof(double),"shake:npartner"); int *nshake = (int *) memory->smalloc(nlocal*sizeof(double),"shake:nshake"); - int **partner_tag = - memory->create_2d_int_array(nlocal,max,"shake:partner_tag"); - int **partner_mask = - memory->create_2d_int_array(nlocal,max,"shake:partner_mask"); - int **partner_type = - memory->create_2d_int_array(nlocal,max,"shake:partner_type"); - int **partner_massflag = - memory->create_2d_int_array(nlocal,max,"shake:partner_massflag"); - int **partner_bondtype = - memory->create_2d_int_array(nlocal,max,"shake:partner_bondtype"); - int **partner_shake = - memory->create_2d_int_array(nlocal,max,"shake:partner_shake"); - int **partner_nshake = - memory->create_2d_int_array(nlocal,max,"shake:partner_nshake"); + int **partner_tag,**partner_mask,**partner_type,**partner_massflag; + int ** partner_bondtype,**partner_shake,**partner_nshake; + memory->create(partner_tag,nlocal,max,"shake:partner_tag"); + memory->create(partner_mask,nlocal,max,"shake:partner_mask"); + memory->create(partner_type,nlocal,max,"shake:partner_type"); + memory->create(partner_massflag,nlocal,max,"shake:partner_massflag"); + memory->create(partner_bondtype,nlocal,max,"shake:partner_bondtype"); + memory->create(partner_shake,nlocal,max,"shake:partner_shake"); + memory->create(partner_nshake,nlocal,max,"shake:partner_nshake"); // ----------------------------------------------------- // set npartner and partner_tag from special arrays @@ -1121,13 +1116,13 @@ void FixShake::find_clusters() memory->sfree(npartner); memory->sfree(nshake); - memory->destroy_2d_int_array(partner_tag); - memory->destroy_2d_int_array(partner_mask); - memory->destroy_2d_int_array(partner_type); - memory->destroy_2d_int_array(partner_massflag); - memory->destroy_2d_int_array(partner_bondtype); - memory->destroy_2d_int_array(partner_shake); - memory->destroy_2d_int_array(partner_nshake); + memory->destroy(partner_tag); + memory->destroy(partner_mask); + memory->destroy(partner_type); + memory->destroy(partner_massflag); + memory->destroy(partner_bondtype); + memory->destroy(partner_shake); + memory->destroy(partner_nshake); // ----------------------------------------------------- // set bond_type and angle_type negative for SHAKE clusters @@ -2244,12 +2239,10 @@ void FixShake::grow_arrays(int nmax) { shake_flag = (int *) memory->srealloc(shake_flag,nmax*sizeof(int),"shake:shake_flag"); - shake_atom = - memory->grow_2d_int_array(shake_atom,nmax,4,"shake:shake_atom"); - shake_type = - memory->grow_2d_int_array(shake_type,nmax,3,"shake:shake_type"); - memory->destroy_2d_double_array(xshake); - xshake = memory->create_2d_double_array(nmax,3,"shake:xshake"); + memory->grow(shake_atom,nmax,4,"shake:shake_atom"); + memory->grow(shake_type,nmax,3,"shake:shake_type"); + memory->destroy(xshake); + memory->create(xshake,nmax,3,"shake:xshake"); } /* ---------------------------------------------------------------------- diff --git a/src/fix_shear_history.cpp b/src/fix_shear_history.cpp index 16ed40dad2a1d0c9fe175a1ec279453ed193eafd..9c8285e84e23ddcd913ba292cae05e0b41fa9118 100644 --- a/src/fix_shear_history.cpp +++ b/src/fix_shear_history.cpp @@ -64,7 +64,7 @@ FixShearHistory::~FixShearHistory() // delete locally stored arrays memory->sfree(npartner); - memory->destroy_2d_int_array(partner); + memory->destroy(partner); memory->destroy(shearpartner); } @@ -178,8 +178,7 @@ void FixShearHistory::grow_arrays(int nmax) { npartner = (int *) memory->srealloc(npartner,nmax*sizeof(int), "shear_history:npartner"); - partner = memory->grow_2d_int_array(partner,nmax,MAXTOUCH, - "shear_history:partner"); + memory->grow(partner,nmax,MAXTOUCH,"shear_history:partner"); memory->grow(shearpartner,nmax,MAXTOUCH,3,"shear_history:shearpartner"); } diff --git a/src/fix_spring_self.cpp b/src/fix_spring_self.cpp index b28807f1f18a54f5e627c1cc4f9c72b4a44f5ece..c36092c3f3e39b9a78ade04e48075294be054715 100644 --- a/src/fix_spring_self.cpp +++ b/src/fix_spring_self.cpp @@ -87,7 +87,7 @@ FixSpringSelf::~FixSpringSelf() // delete locally stored array - memory->destroy_2d_double_array(xoriginal); + memory->destroy(xoriginal); } /* ---------------------------------------------------------------------- */ @@ -205,8 +205,7 @@ double FixSpringSelf::memory_usage() void FixSpringSelf::grow_arrays(int nmax) { - xoriginal = - memory->grow_2d_double_array(xoriginal,nmax,3,"fix_spring/self:xoriginal"); + memory->grow(xoriginal,nmax,3,"fix_spring/self:xoriginal"); } /* ---------------------------------------------------------------------- diff --git a/src/fix_store_force.cpp b/src/fix_store_force.cpp index 820ea0729e3c4408394c986acb561945110d8079..6af760c9d934d9ff172043fb4717b80f30975779 100644 --- a/src/fix_store_force.cpp +++ b/src/fix_store_force.cpp @@ -34,7 +34,7 @@ FixStoreForce::FixStoreForce(LAMMPS *lmp, int narg, char **arg) : peratom_freq = 1; nmax = atom->nmax; - foriginal = memory->create_2d_double_array(nmax,3,"store/force:foriginal"); + memory->create(foriginal,nmax,3,"store/force:foriginal"); array_atom = foriginal; // zero the array since dump may access it on timestep 0 @@ -49,7 +49,7 @@ FixStoreForce::FixStoreForce(LAMMPS *lmp, int narg, char **arg) : FixStoreForce::~FixStoreForce() { - memory->destroy_2d_double_array(foriginal); + memory->destroy(foriginal); } /* ---------------------------------------------------------------------- */ @@ -97,8 +97,8 @@ void FixStoreForce::post_force(int vflag) { if (atom->nlocal > nmax) { nmax = atom->nmax; - memory->destroy_2d_double_array(foriginal); - foriginal = memory->create_2d_double_array(nmax,3,"store/force:foriginal"); + memory->destroy(foriginal); + memory->create(foriginal,nmax,3,"store/force:foriginal"); array_atom = foriginal; } diff --git a/src/fix_store_state.cpp b/src/fix_store_state.cpp index 3ca60828671e51657aefd8c329f601ff5cfd0308..5dc2746839b613ecce0aa7e8f302a5aac1c6131d 100644 --- a/src/fix_store_state.cpp +++ b/src/fix_store_state.cpp @@ -333,7 +333,7 @@ FixStoreState::~FixStoreState() delete [] value2index; delete [] pack_choice; - memory->destroy_2d_double_array(values); + memory->destroy(values); } /* ---------------------------------------------------------------------- */ @@ -485,8 +485,7 @@ double FixStoreState::memory_usage() void FixStoreState::grow_arrays(int nmax) { - values = memory->grow_2d_double_array(values,nmax,nvalues, - "fix_store:values"); + memory->grow(values,nmax,nvalues,"fix_store:values"); if (nvalues == 1) { if (nmax) vector_atom = &values[0][0]; else vector_atom = NULL; diff --git a/src/fix_tmd.cpp b/src/fix_tmd.cpp index 496b508619e32531354b5c00a8b692fd7bead63f..b2dfd9013897e01d1811c4f6e62110112a538854 100644 --- a/src/fix_tmd.cpp +++ b/src/fix_tmd.cpp @@ -141,8 +141,8 @@ FixTMD::~FixTMD() // delete locally stored arrays - memory->destroy_2d_double_array(xf); - memory->destroy_2d_double_array(xold); + memory->destroy(xf); + memory->destroy(xold); } /* ---------------------------------------------------------------------- */ @@ -350,8 +350,8 @@ double FixTMD::memory_usage() void FixTMD::grow_arrays(int nmax) { - xf = memory->grow_2d_double_array(xf,nmax,3,"fix_tmd:xf"); - xold = memory->grow_2d_double_array(xold,nmax,3,"fix_tmd:xold"); + memory->grow(xf,nmax,3,"fix_tmd:xf"); + memory->grow(xold,nmax,3,"fix_tmd:xold"); } /* ---------------------------------------------------------------------- diff --git a/src/fix_ttm.cpp b/src/fix_ttm.cpp index 2379730140d0ecd026da081cdc97948ba6e12150..9dfebc91a64633b59948fd6f1e40c8c545104fbd 100644 --- a/src/fix_ttm.cpp +++ b/src/fix_ttm.cpp @@ -173,7 +173,7 @@ FixTTM::~FixTTM() memory->destroy(sum_mass_vsq_all); memory->destroy(T_electron_old); memory->destroy(T_electron); - memory->destroy_2d_double_array(flangevin); + memory->destroy(flangevin); memory->destroy(net_energy_transfer); memory->destroy(net_energy_transfer_all); } @@ -554,7 +554,7 @@ double FixTTM::memory_usage() void FixTTM::grow_arrays(int ngrow) { - flangevin = memory->grow_2d_double_array(flangevin,ngrow,3,"TTM:flangevin"); + memory->grow(flangevin,ngrow,3,"TTM:flangevin"); } diff --git a/src/improper.cpp b/src/improper.cpp index 8697d9f7227dc620e965693e0a897a7e65de8533..c68d088294e4fa86900e24d65107465a228e19e8 100644 --- a/src/improper.cpp +++ b/src/improper.cpp @@ -39,7 +39,7 @@ Improper::Improper(LAMMPS *lmp) : Pointers(lmp) Improper::~Improper() { memory->sfree(eatom); - memory->destroy_2d_double_array(vatom); + memory->destroy(vatom); } /* ---------------------------------------------------------------------- @@ -81,8 +81,8 @@ void Improper::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 diff --git a/src/lattice.cpp b/src/lattice.cpp index 5a7ba060c1c864ab3ffa9bf800cd00fdaf5e4080..48e749834c310935cc371dcde42f015d52ed9183 100644 --- a/src/lattice.cpp +++ b/src/lattice.cpp @@ -299,7 +299,7 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) Lattice::~Lattice() { - memory->destroy_2d_double_array(basis); + memory->destroy(basis); } /* ---------------------------------------------------------------------- @@ -514,7 +514,7 @@ void Lattice::box2lattice(double &x, double &y, double &z) void Lattice::add_basis(double x, double y, double z) { - basis = memory->grow_2d_double_array(basis,nbasis+1,3,"lattice:basis"); + memory->grow(basis,nbasis+1,3,"lattice:basis"); basis[nbasis][0] = x; basis[nbasis][1] = y; basis[nbasis][2] = z; diff --git a/src/memory.cpp b/src/memory.cpp index cf8f5eb4c6c0cbc1b6ac24a04cd9b257056deb35..e6d64df0cde8aafb8aea5ec0207a92288a324671 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -84,149 +84,3 @@ void Memory::fail(const char *name) sprintf(str,"Cannot create/grow a vector/array of pointers for %s",name); error->one(str); } - -/* ---------------------------------------------------------------------- - older routines, will be deprecated at some point -------------------------------------------------------------------------- */ - -/* ---------------------------------------------------------------------- - create a 2d double array -------------------------------------------------------------------------- */ - -double **Memory::create_2d_double_array(int n1, int n2, const char *name) - -{ - double *data = (double *) smalloc(n1*n2*sizeof(double),name); - double **array = (double **) smalloc(n1*sizeof(double *),name); - - int n = 0; - for (int i = 0; i < n1; i++) { - array[i] = &data[n]; - n += n2; - } - - return array; -} - -/* ---------------------------------------------------------------------- - free a 2d double array -------------------------------------------------------------------------- */ - -void Memory::destroy_2d_double_array(double **array) - -{ - if (array == NULL) return; - sfree(array[0]); - sfree(array); -} - -/* ---------------------------------------------------------------------- - grow or shrink 1st dim of a 2d double array - last dim must stay the same - if either dim is 0, return NULL -------------------------------------------------------------------------- */ - -double **Memory::grow_2d_double_array(double **array, - int n1, int n2, const char *name) - -{ - if (array == NULL) return create_2d_double_array(n1,n2,name); - - double *data = (double *) srealloc(array[0],n1*n2*sizeof(double),name); - array = (double **) srealloc(array,n1*sizeof(double *),name); - - int n = 0; - for (int i = 0; i < n1; i++) { - array[i] = &data[n]; - n += n2; - } - - return array; -} - -/* ---------------------------------------------------------------------- - create a 2d int array - if either dim is 0, return NULL -------------------------------------------------------------------------- */ - -int **Memory::create_2d_int_array(int n1, int n2, const char *name) - -{ - if (n1 == 0 || n2 == 0) return NULL; - - int *data = (int *) smalloc(n1*n2*sizeof(int),name); - int **array = (int **) smalloc(n1*sizeof(int *),name); - - int n = 0; - for (int i = 0; i < n1; i++) { - array[i] = &data[n]; - n += n2; - } - - return array; -} - -/* ---------------------------------------------------------------------- - free a 2d int array -------------------------------------------------------------------------- */ - -void Memory::destroy_2d_int_array(int **array) - -{ - if (array == NULL) return; - sfree(array[0]); - sfree(array); -} - -/* ---------------------------------------------------------------------- - grow or shrink 1st dim of a 2d int array - last dim must stay the same - if either dim is 0, return NULL -------------------------------------------------------------------------- */ - -int **Memory::grow_2d_int_array(int **array, int n1, int n2, const char *name) - -{ - if (n1 == 0 || n2 == 0) { - destroy_2d_int_array(array); - return NULL; - } - - if (array == NULL) return create_2d_int_array(n1,n2,name); - - int *data = (int *) srealloc(array[0],n1*n2*sizeof(int),name); - array = (int **) srealloc(array,n1*sizeof(int *),name); - - int n = 0; - for (int i = 0; i < n1; i++) { - array[i] = &data[n]; - n += n2; - } - - return array; -} - -/* ---------------------------------------------------------------------- - create a 2d double array with 2nd index from n2lo to n2hi inclusive -------------------------------------------------------------------------- */ - -double **Memory::create_2d_double_array(int n1, int n2lo, int n2hi, - const char *name) -{ - int n2 = n2hi - n2lo + 1; - double **array = create_2d_double_array(n1,n2,name); - - for (int i = 0; i < n1; i++) array[i] -= n2lo; - return array; -} - -/* ---------------------------------------------------------------------- - free a 2d double array with 2nd index offset -------------------------------------------------------------------------- */ - -void Memory::destroy_2d_double_array(double **array, int offset) -{ - if (array == NULL) return; - sfree(&array[0][offset]); - sfree(array); -} diff --git a/src/memory.h b/src/memory.h index c90dff2d860c144b35e9a1e2068b4c03794b22ba..f8d0eaa6c110ce463cd61d2d084ed723dd9bc808 100644 --- a/src/memory.h +++ b/src/memory.h @@ -28,21 +28,6 @@ class Memory : protected Pointers { void sfree(void *); void fail(const char *); - // older routines, will be deprecated at some point - - double **create_2d_double_array(int, int, const char *); - void destroy_2d_double_array(double **); - double **grow_2d_double_array(double **, int, int, const char *); - - int **create_2d_int_array(int, int, const char *); - void destroy_2d_int_array(int **); - int **grow_2d_int_array(int **, int, int, const char *); - - double **create_2d_double_array(int, int, int, const char *); - void destroy_2d_double_array(double **, int); - - // newer routines - /* ---------------------------------------------------------------------- create/grow/destroy vecs and multidim arrays with contiguous memory blocks only use with primitive data types, e.g. 1d vec of ints, 2d array of doubles diff --git a/src/pair.cpp b/src/pair.cpp index da8191064242bb77c07c49cf4449796e74bdf8b3..333e03789c343e5f3f2a5cf1129d0d860b7258ec 100644 --- a/src/pair.cpp +++ b/src/pair.cpp @@ -81,7 +81,7 @@ Pair::Pair(LAMMPS *lmp) : Pointers(lmp) Pair::~Pair() { memory->sfree(eatom); - memory->destroy_2d_double_array(vatom); + memory->destroy(vatom); } /* ---------------------------------------------------------------------- @@ -287,8 +287,8 @@ void Pair::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,"pair:vatom"); + memory->destroy(vatom); + memory->create(vatom,maxvatom,6,"pair:vatom"); } // zero accumulators diff --git a/src/pair_born.cpp b/src/pair_born.cpp index 13194d43b02bc2a2ec5a58b1bdbf2ac9add3ff4c..ba9953d8b1173d787aac41e327e27fad42577d74 100644 --- a/src/pair_born.cpp +++ b/src/pair_born.cpp @@ -41,20 +41,20 @@ PairBorn::PairBorn(LAMMPS *lmp) : Pair(lmp) {} PairBorn::~PairBorn() { if (allocated) { - memory->destroy_2d_int_array(setflag); - memory->destroy_2d_double_array(cutsq); - - memory->destroy_2d_double_array(cut); - 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(setflag); + memory->destroy(cutsq); + + memory->destroy(cut); + 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); } } @@ -153,24 +153,24 @@ void PairBorn::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"); - 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(cutsq,n+1,n+1,"pair:cutsq"); + + memory->create(cut,n+1,n+1,"pair:cut"); + 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"); } /* ---------------------------------------------------------------------- diff --git a/src/pair_buck.cpp b/src/pair_buck.cpp index 8d02aa2b84bbd4b726bd2e6d55923ce87c14fb2f..6b91e23056d5f01c21b62732f843ba3cebcec968 100644 --- a/src/pair_buck.cpp +++ b/src/pair_buck.cpp @@ -37,17 +37,17 @@ PairBuck::PairBuck(LAMMPS *lmp) : Pair(lmp) {} PairBuck::~PairBuck() { if (allocated) { - memory->destroy_2d_int_array(setflag); - memory->destroy_2d_double_array(cutsq); - - memory->destroy_2d_double_array(cut); - 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(setflag); + memory->destroy(cutsq); + + memory->destroy(cut); + memory->destroy(a); + memory->destroy(rho); + memory->destroy(c); + memory->destroy(rhoinv); + memory->destroy(buck1); + memory->destroy(buck2); + memory->destroy(offset); } } @@ -145,21 +145,21 @@ void PairBuck::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_lj"); - 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,n+1,n+1,"pair:cut_lj"); + 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"); } /* ---------------------------------------------------------------------- diff --git a/src/pair_buck_coul_cut.cpp b/src/pair_buck_coul_cut.cpp index 4d57d22186d20d503533bef67cfa1562843e7651..9fa00e13b6fb9b56dc806cbfc8695c0eb50e56a2 100644 --- a/src/pair_buck_coul_cut.cpp +++ b/src/pair_buck_coul_cut.cpp @@ -41,20 +41,20 @@ PairBuckCoulCut::PairBuckCoulCut(LAMMPS *lmp) : Pair(lmp) {} PairBuckCoulCut::~PairBuckCoulCut() { if (allocated) { - memory->destroy_2d_int_array(setflag); - memory->destroy_2d_double_array(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(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(setflag); + memory->destroy(cutsq); + + memory->destroy(cut_lj); + memory->destroy(cut_ljsq); + memory->destroy(cut_coul); + memory->destroy(cut_coulsq); + memory->destroy(a); + memory->destroy(rho); + memory->destroy(c); + memory->destroy(rhoinv); + memory->destroy(buck1); + memory->destroy(buck2); + memory->destroy(offset); } } @@ -170,24 +170,25 @@ void PairBuckCoulCut::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_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"); - 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(cutsq,n+1,n+1,"pair:cutsq"); + + 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(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"); } /* ---------------------------------------------------------------------- diff --git a/src/pair_coul_cut.cpp b/src/pair_coul_cut.cpp index f361f0ad9a0dded97bad7e5175c2eb3765efac5d..cc92998f021249fc9ac37ca805935f01a6eb45e2 100644 --- a/src/pair_coul_cut.cpp +++ b/src/pair_coul_cut.cpp @@ -38,11 +38,11 @@ PairCoulCut::PairCoulCut(LAMMPS *lmp) : Pair(lmp) {} PairCoulCut::~PairCoulCut() { 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(scale); + memory->destroy(cut); + memory->destroy(scale); } } @@ -137,15 +137,15 @@ void PairCoulCut::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"); - scale = memory->create_2d_double_array(n+1,n+1,"pair:scale"); + memory->create(cut,n+1,n+1,"pair:cut"); + memory->create(scale,n+1,n+1,"pair:scale"); } /* ---------------------------------------------------------------------- diff --git a/src/pair_dpd.cpp b/src/pair_dpd.cpp index fe38c8692336a0e646ccba30ff13f6e750345faf..6a42decede754296456015c7f5add21e0cc5e8b0 100644 --- a/src/pair_dpd.cpp +++ b/src/pair_dpd.cpp @@ -49,13 +49,13 @@ PairDPD::PairDPD(LAMMPS *lmp) : Pair(lmp) PairDPD::~PairDPD() { 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(a0); - memory->destroy_2d_double_array(gamma); - memory->destroy_2d_double_array(sigma); + memory->destroy(cut); + memory->destroy(a0); + memory->destroy(gamma); + memory->destroy(sigma); } if (random) delete random; @@ -174,17 +174,17 @@ void PairDPD::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"); - a0 = memory->create_2d_double_array(n+1,n+1,"pair:a0"); - gamma = memory->create_2d_double_array(n+1,n+1,"pair:gamma"); - sigma = memory->create_2d_double_array(n+1,n+1,"pair:sigma"); + memory->create(cut,n+1,n+1,"pair:cut"); + memory->create(a0,n+1,n+1,"pair:a0"); + memory->create(gamma,n+1,n+1,"pair:gamma"); + memory->create(sigma,n+1,n+1,"pair:sigma"); } /* ---------------------------------------------------------------------- diff --git a/src/pair_gauss.cpp b/src/pair_gauss.cpp index f59c3ad27000db99686d7e5e9175740bbce9753c..ad3d15f4aee9c70b8d1671021ef965c635b40ef1 100644 --- a/src/pair_gauss.cpp +++ b/src/pair_gauss.cpp @@ -50,13 +50,13 @@ PairGauss::~PairGauss() delete [] pvector; 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(a); - memory->destroy_2d_double_array(b); - memory->destroy_2d_double_array(offset); + memory->destroy(cut); + memory->destroy(a); + memory->destroy(b); + memory->destroy(offset); } } @@ -150,17 +150,17 @@ void PairGauss::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 = 1; 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_gauss"); - a = memory->create_2d_double_array(n+1,n+1,"pair:a"); - b = memory->create_2d_double_array(n+1,n+1,"pair:b"); - offset = memory->create_2d_double_array(n+1,n+1,"pair:offset"); + memory->create(cut,n+1,n+1,"pair:cut_gauss"); + memory->create(a,n+1,n+1,"pair:a"); + memory->create(b,n+1,n+1,"pair:b"); + memory->create(offset,n+1,n+1,"pair:offset"); } /* ---------------------------------------------------------------------- diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index 3b2e3ae9aaf3ded1a12e8ec6021ce1cfec83363e..786eb674fda599963c1e021f2a2ae5254e2cc4ae 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -49,10 +49,10 @@ PairHybrid::~PairHybrid() } if (allocated) { - memory->destroy_2d_int_array(setflag); - memory->destroy_2d_double_array(cutsq); - memory->destroy_2d_double_array(cutghost); - memory->destroy_2d_int_array(nmap); + memory->destroy(setflag); + memory->destroy(cutsq); + memory->destroy(cutghost); + memory->destroy(nmap); memory->destroy(map); } } @@ -152,15 +152,15 @@ void PairHybrid::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"); - nmap = memory->create_2d_int_array(n+1,n+1,"pair:nmap"); + memory->create(nmap,n+1,n+1,"pair:nmap"); memory->create(map,n+1,n+1,nstyles,"pair:map"); for (int i = 1; i <= n; i++) for (int j = i; j <= n; j++) @@ -187,10 +187,10 @@ void PairHybrid::settings(int narg, char **arg) } if (allocated) { - memory->destroy_2d_int_array(setflag); - memory->destroy_2d_double_array(cutsq); - memory->destroy_2d_double_array(cutghost); - memory->destroy_2d_int_array(nmap); + memory->destroy(setflag); + memory->destroy(cutsq); + memory->destroy(cutghost); + memory->destroy(nmap); memory->destroy(map); } allocated = 0; @@ -395,8 +395,8 @@ void PairHybrid::init_style() // set iskip = 1 only if all ijskip for itype are 1 int *iskip = new int[ntypes+1]; - int **ijskip = memory->create_2d_int_array(ntypes+1,ntypes+1, - "pair_hybrid:ijskip"); + int **ijskip; + memory->create(ijskip,ntypes+1,ntypes+1,"pair_hybrid:ijskip"); for (itype = 1; itype <= ntypes; itype++) for (jtype = 1; jtype <= ntypes; jtype++) @@ -434,7 +434,7 @@ void PairHybrid::init_style() neighbor->requests[i]->ijskip = ijskip; } else { delete [] iskip; - memory->destroy_2d_int_array(ijskip); + memory->destroy(ijskip); } } diff --git a/src/pair_lj96_cut.cpp b/src/pair_lj96_cut.cpp index f34551abd257f2949e61813c2b6e1cce9ca3c8bc..03b9a4455b04dcda308daa51fc52454aa6a358cc 100644 --- a/src/pair_lj96_cut.cpp +++ b/src/pair_lj96_cut.cpp @@ -49,17 +49,17 @@ PairLJ96Cut::PairLJ96Cut(LAMMPS *lmp) : Pair(lmp) PairLJ96Cut::~PairLJ96Cut() { if (allocated) { - memory->destroy_2d_int_array(setflag); - memory->destroy_2d_double_array(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(setflag); + memory->destroy(cutsq); + + memory->destroy(cut); + memory->destroy(epsilon); + memory->destroy(sigma); + memory->destroy(lj1); + memory->destroy(lj2); + memory->destroy(lj3); + memory->destroy(lj4); + memory->destroy(offset); } } @@ -431,21 +431,21 @@ void PairLJ96Cut::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"); } /* ---------------------------------------------------------------------- diff --git a/src/pair_lj_cut.cpp b/src/pair_lj_cut.cpp index 9084ec0182015387d19364e53f4b19d37071ecfa..2c36c5401e5784bd350451240e6480c863142f19 100644 --- a/src/pair_lj_cut.cpp +++ b/src/pair_lj_cut.cpp @@ -49,17 +49,17 @@ PairLJCut::PairLJCut(LAMMPS *lmp) : Pair(lmp) PairLJCut::~PairLJCut() { if (allocated) { - memory->destroy_2d_int_array(setflag); - memory->destroy_2d_double_array(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(setflag); + memory->destroy(cutsq); + + memory->destroy(cut); + memory->destroy(epsilon); + memory->destroy(sigma); + memory->destroy(lj1); + memory->destroy(lj2); + memory->destroy(lj3); + memory->destroy(lj4); + memory->destroy(offset); } } @@ -424,21 +424,21 @@ void PairLJCut::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"); } /* ---------------------------------------------------------------------- diff --git a/src/pair_lj_cut_coul_cut.cpp b/src/pair_lj_cut_coul_cut.cpp index 4cf101a0c472bc5aaf92fe49b405d6c49931fc45..c55c50ea6abbb3a3149927bac11d7550d215ef3d 100644 --- a/src/pair_lj_cut_coul_cut.cpp +++ b/src/pair_lj_cut_coul_cut.cpp @@ -38,20 +38,20 @@ PairLJCutCoulCut::PairLJCutCoulCut(LAMMPS *lmp) : Pair(lmp) {} PairLJCutCoulCut::~PairLJCutCoulCut() { if (allocated) { - memory->destroy_2d_int_array(setflag); - memory->destroy_2d_double_array(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(setflag); + memory->destroy(cutsq); + + 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); } } @@ -164,24 +164,24 @@ void PairLJCutCoulCut::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_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(cutsq,n+1,n+1,"pair:cutsq"); + + 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"); } /* ---------------------------------------------------------------------- diff --git a/src/pair_lj_expand.cpp b/src/pair_lj_expand.cpp index 6ea9d7692edad83f57b6592c4d9194a23b22fd9e..7f255258d1b8c578cdf986e5a6893d00d32b04f6 100644 --- a/src/pair_lj_expand.cpp +++ b/src/pair_lj_expand.cpp @@ -36,18 +36,18 @@ PairLJExpand::PairLJExpand(LAMMPS *lmp) : Pair(lmp) {} PairLJExpand::~PairLJExpand() { if (allocated) { - memory->destroy_2d_int_array(setflag); - memory->destroy_2d_double_array(cutsq); - - memory->destroy_2d_double_array(cut); - memory->destroy_2d_double_array(epsilon); - memory->destroy_2d_double_array(sigma); - memory->destroy_2d_double_array(shift); - 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(setflag); + memory->destroy(cutsq); + + memory->destroy(cut); + memory->destroy(epsilon); + memory->destroy(sigma); + memory->destroy(shift); + memory->destroy(lj1); + memory->destroy(lj2); + memory->destroy(lj3); + memory->destroy(lj4); + memory->destroy(offset); } } @@ -146,22 +146,22 @@ void PairLJExpand::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"); - epsilon = memory->create_2d_double_array(n+1,n+1,"pair:epsilon"); - sigma = memory->create_2d_double_array(n+1,n+1,"pair:sigma"); - shift = memory->create_2d_double_array(n+1,n+1,"pair:shift"); - 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(cutsq,n+1,n+1,"pair:cutsq"); + + 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(shift,n+1,n+1,"pair:shift"); + 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"); } /* ---------------------------------------------------------------------- diff --git a/src/pair_lj_gromacs.cpp b/src/pair_lj_gromacs.cpp index 6fb2786b08fbb1117427cfa9baca0a1bfe29b348..b2c567d949c0cb88ac6bfc1e3bfef4b29acb569e 100644 --- a/src/pair_lj_gromacs.cpp +++ b/src/pair_lj_gromacs.cpp @@ -42,23 +42,23 @@ PairLJGromacs::PairLJGromacs(LAMMPS *lmp) : Pair(lmp) {} PairLJGromacs::~PairLJGromacs() { if (allocated) { - memory->destroy_2d_int_array(setflag); - memory->destroy_2d_double_array(cutsq); - - memory->destroy_2d_double_array(cut); - memory->destroy_2d_double_array(cut_inner); - memory->destroy_2d_double_array(cut_inner_sq); - 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(ljsw1); - memory->destroy_2d_double_array(ljsw2); - memory->destroy_2d_double_array(ljsw3); - memory->destroy_2d_double_array(ljsw4); - memory->destroy_2d_double_array(ljsw5); + memory->destroy(setflag); + memory->destroy(cutsq); + + memory->destroy(cut); + memory->destroy(cut_inner); + memory->destroy(cut_inner_sq); + memory->destroy(epsilon); + memory->destroy(sigma); + memory->destroy(lj1); + memory->destroy(lj2); + memory->destroy(lj3); + memory->destroy(lj4); + memory->destroy(ljsw1); + memory->destroy(ljsw2); + memory->destroy(ljsw3); + memory->destroy(ljsw4); + memory->destroy(ljsw5); } } @@ -165,27 +165,27 @@ void PairLJGromacs::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"); - cut_inner = memory->create_2d_double_array(n+1,n+1,"pair:cut_inner"); - cut_inner_sq = memory->create_2d_double_array(n+1,n+1,"pair:cut_inner_sq"); - 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"); - ljsw1 = memory->create_2d_double_array(n+1,n+1,"pair:ljsw1"); - ljsw2 = memory->create_2d_double_array(n+1,n+1,"pair:ljsw2"); - ljsw3 = memory->create_2d_double_array(n+1,n+1,"pair:ljsw3"); - ljsw4 = memory->create_2d_double_array(n+1,n+1,"pair:ljsw4"); - ljsw5 = memory->create_2d_double_array(n+1,n+1,"pair:ljsw5"); + memory->create(cutsq,n+1,n+1,"pair:cutsq"); + + memory->create(cut,n+1,n+1,"pair:cut"); + memory->create(cut_inner,n+1,n+1,"pair:cut_inner"); + memory->create(cut_inner_sq,n+1,n+1,"pair:cut_inner_sq"); + 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(ljsw1,n+1,n+1,"pair:ljsw1"); + memory->create(ljsw2,n+1,n+1,"pair:ljsw2"); + memory->create(ljsw3,n+1,n+1,"pair:ljsw3"); + memory->create(ljsw4,n+1,n+1,"pair:ljsw4"); + memory->create(ljsw5,n+1,n+1,"pair:ljsw5"); } /* ---------------------------------------------------------------------- diff --git a/src/pair_lj_gromacs_coul_gromacs.cpp b/src/pair_lj_gromacs_coul_gromacs.cpp index f5e49a5167dd19e5ff9c280fe75c34c6ea511d5c..83332d9dc5654a717d151e6af86d296ab632aaf0 100644 --- a/src/pair_lj_gromacs_coul_gromacs.cpp +++ b/src/pair_lj_gromacs_coul_gromacs.cpp @@ -42,20 +42,20 @@ PairLJGromacsCoulGromacs::PairLJGromacsCoulGromacs(LAMMPS *lmp) : Pair(lmp) {} PairLJGromacsCoulGromacs::~PairLJGromacsCoulGromacs() { if (allocated) { - memory->destroy_2d_int_array(setflag); - memory->destroy_2d_double_array(cutsq); - - 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(ljsw1); - memory->destroy_2d_double_array(ljsw2); - memory->destroy_2d_double_array(ljsw3); - memory->destroy_2d_double_array(ljsw4); - memory->destroy_2d_double_array(ljsw5); + memory->destroy(setflag); + memory->destroy(cutsq); + + memory->destroy(epsilon); + memory->destroy(sigma); + memory->destroy(lj1); + memory->destroy(lj2); + memory->destroy(lj3); + memory->destroy(lj4); + memory->destroy(ljsw1); + memory->destroy(ljsw2); + memory->destroy(ljsw3); + memory->destroy(ljsw4); + memory->destroy(ljsw5); } } @@ -195,24 +195,24 @@ void PairLJGromacsCoulGromacs::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"); - - 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"); - ljsw1 = memory->create_2d_double_array(n+1,n+1,"pair:ljsw1"); - ljsw2 = memory->create_2d_double_array(n+1,n+1,"pair:ljsw2"); - ljsw3 = memory->create_2d_double_array(n+1,n+1,"pair:ljsw3"); - ljsw4 = memory->create_2d_double_array(n+1,n+1,"pair:ljsw4"); - ljsw5 = memory->create_2d_double_array(n+1,n+1,"pair:ljsw5"); + memory->create(cutsq,n+1,n+1,"pair:cutsq"); + + 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(ljsw1,n+1,n+1,"pair:ljsw1"); + memory->create(ljsw2,n+1,n+1,"pair:ljsw2"); + memory->create(ljsw3,n+1,n+1,"pair:ljsw3"); + memory->create(ljsw4,n+1,n+1,"pair:ljsw4"); + memory->create(ljsw5,n+1,n+1,"pair:ljsw5"); } /* ---------------------------------------------------------------------- diff --git a/src/pair_lj_smooth.cpp b/src/pair_lj_smooth.cpp index ce67ce482ab48118c43f1f1f38d883c9382a5ba0..d49a23bbfb5928996055d05b74906179b6cc8b11 100644 --- a/src/pair_lj_smooth.cpp +++ b/src/pair_lj_smooth.cpp @@ -40,24 +40,24 @@ PairLJSmooth::PairLJSmooth(LAMMPS *lmp) : Pair(lmp) {} PairLJSmooth::~PairLJSmooth() { if (allocated) { - memory->destroy_2d_int_array(setflag); - memory->destroy_2d_double_array(cutsq); - - memory->destroy_2d_double_array(cut); - memory->destroy_2d_double_array(cut_inner); - memory->destroy_2d_double_array(cut_inner_sq); - 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(ljsw0); - memory->destroy_2d_double_array(ljsw1); - memory->destroy_2d_double_array(ljsw2); - memory->destroy_2d_double_array(ljsw3); - memory->destroy_2d_double_array(ljsw4); - memory->destroy_2d_double_array(offset); + memory->destroy(setflag); + memory->destroy(cutsq); + + memory->destroy(cut); + memory->destroy(cut_inner); + memory->destroy(cut_inner_sq); + memory->destroy(epsilon); + memory->destroy(sigma); + memory->destroy(lj1); + memory->destroy(lj2); + memory->destroy(lj3); + memory->destroy(lj4); + memory->destroy(ljsw0); + memory->destroy(ljsw1); + memory->destroy(ljsw2); + memory->destroy(ljsw3); + memory->destroy(ljsw4); + memory->destroy(offset); } } @@ -168,28 +168,28 @@ void PairLJSmooth::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"); - cut_inner = memory->create_2d_double_array(n+1,n+1,"pair:cut_inner"); - cut_inner_sq = memory->create_2d_double_array(n+1,n+1,"pair:cut_inner_sq"); - 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"); - ljsw0 = memory->create_2d_double_array(n+1,n+1,"pair:ljsw0"); - ljsw1 = memory->create_2d_double_array(n+1,n+1,"pair:ljsw1"); - ljsw2 = memory->create_2d_double_array(n+1,n+1,"pair:ljsw2"); - ljsw3 = memory->create_2d_double_array(n+1,n+1,"pair:ljsw3"); - ljsw4 = memory->create_2d_double_array(n+1,n+1,"pair:ljsw4"); - offset = memory->create_2d_double_array(n+1,n+1,"pair:offset"); + memory->create(cutsq,n+1,n+1,"pair:cutsq"); + + memory->create(cut,n+1,n+1,"pair:cut"); + memory->create(cut_inner,n+1,n+1,"pair:cut_inner"); + memory->create(cut_inner_sq,n+1,n+1,"pair:cut_inner_sq"); + 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(ljsw0,n+1,n+1,"pair:ljsw0"); + memory->create(ljsw1,n+1,n+1,"pair:ljsw1"); + memory->create(ljsw2,n+1,n+1,"pair:ljsw2"); + memory->create(ljsw3,n+1,n+1,"pair:ljsw3"); + memory->create(ljsw4,n+1,n+1,"pair:ljsw4"); + memory->create(offset,n+1,n+1,"pair:offset"); } /* ---------------------------------------------------------------------- diff --git a/src/pair_morse.cpp b/src/pair_morse.cpp index 61a3ba1b4e82ee2eed13e2d64e5845f27374ebe1..d01e227fac36c7e61993c3e03b06fb1c3d64fb9d 100644 --- a/src/pair_morse.cpp +++ b/src/pair_morse.cpp @@ -36,15 +36,15 @@ PairMorse::PairMorse(LAMMPS *lmp) : Pair(lmp) {} PairMorse::~PairMorse() { if (allocated) { - memory->destroy_2d_int_array(setflag); - memory->destroy_2d_double_array(cutsq); - - memory->destroy_2d_double_array(cut); - memory->destroy_2d_double_array(d0); - memory->destroy_2d_double_array(alpha); - memory->destroy_2d_double_array(r0); - memory->destroy_2d_double_array(morse1); - memory->destroy_2d_double_array(offset); + memory->destroy(setflag); + memory->destroy(cutsq); + + memory->destroy(cut); + memory->destroy(d0); + memory->destroy(alpha); + memory->destroy(r0); + memory->destroy(morse1); + memory->destroy(offset); } } @@ -139,19 +139,19 @@ void PairMorse::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"); - d0 = memory->create_2d_double_array(n+1,n+1,"pair:d0"); - alpha = memory->create_2d_double_array(n+1,n+1,"pair:alpha"); - r0 = memory->create_2d_double_array(n+1,n+1,"pair:r0"); - morse1 = memory->create_2d_double_array(n+1,n+1,"pair:morse1"); - offset = memory->create_2d_double_array(n+1,n+1,"pair:offset"); + memory->create(cut,n+1,n+1,"pair:cut"); + memory->create(d0,n+1,n+1,"pair:d0"); + memory->create(alpha,n+1,n+1,"pair:alpha"); + memory->create(r0,n+1,n+1,"pair:r0"); + memory->create(morse1,n+1,n+1,"pair:morse1"); + memory->create(offset,n+1,n+1,"pair:offset"); } /* ---------------------------------------------------------------------- diff --git a/src/pair_soft.cpp b/src/pair_soft.cpp index e9e6bd0d8e5d1dcdc1893cc2d0bb2015ce311784..c58290e35ee24694efeb4bc3d93ca5c2ecc271ee 100644 --- a/src/pair_soft.cpp +++ b/src/pair_soft.cpp @@ -41,11 +41,11 @@ PairSoft::PairSoft(LAMMPS *lmp) : Pair(lmp) PairSoft::~PairSoft() { 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(prefactor); - memory->destroy_2d_double_array(cut); + memory->destroy(prefactor); + memory->destroy(cut); } } @@ -138,15 +138,15 @@ void PairSoft::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"); - prefactor = memory->create_2d_double_array(n+1,n+1,"pair:prefactor"); - cut = memory->create_2d_double_array(n+1,n+1,"pair:cut"); + memory->create(prefactor,n+1,n+1,"pair:prefactor"); + memory->create(cut,n+1,n+1,"pair:cut"); } /* ---------------------------------------------------------------------- diff --git a/src/pair_table.cpp b/src/pair_table.cpp index 74f01659d650abe05a2b96a7482977340967ca9a..f9af94bdec4da2c282e932e76cc6ec073c6c4f18 100644 --- a/src/pair_table.cpp +++ b/src/pair_table.cpp @@ -59,9 +59,9 @@ PairTable::~PairTable() memory->sfree(tables); if (allocated) { - memory->destroy_2d_int_array(setflag); - memory->destroy_2d_double_array(cutsq); - memory->destroy_2d_int_array(tabindex); + memory->destroy(setflag); + memory->destroy(cutsq); + memory->destroy(tabindex); } } @@ -196,13 +196,13 @@ void PairTable::allocate() allocated = 1; int nt = atom->ntypes; - setflag = memory->create_2d_int_array(nt+1,nt+1,"pair:setflag"); + memory->create(setflag,nt+1,nt+1,"pair:setflag"); for (int i = 1; i <= nt; i++) for (int j = i; j <= nt; j++) setflag[i][j] = 0; - cutsq = memory->create_2d_double_array(nt+1,nt+1,"pair:cutsq"); - tabindex = memory->create_2d_int_array(nt+1,nt+1,"pair:tabindex"); + memory->create(cutsq,nt+1,nt+1,"pair:cutsq"); + memory->create(tabindex,nt+1,nt+1,"pair:tabindex"); } /* ---------------------------------------------------------------------- @@ -230,9 +230,9 @@ void PairTable::settings(int narg, char **arg) memory->sfree(tables); if (allocated) { - memory->destroy_2d_int_array(setflag); - memory->destroy_2d_double_array(cutsq); - memory->destroy_2d_int_array(tabindex); + memory->destroy(setflag); + memory->destroy(cutsq); + memory->destroy(tabindex); } allocated = 0; diff --git a/src/pair_yukawa.cpp b/src/pair_yukawa.cpp index 6ee2169776aeb754b669c8f835e117bb7803d60d..b755aefb6e19f229c362ac14f22d88f5483928a5 100644 --- a/src/pair_yukawa.cpp +++ b/src/pair_yukawa.cpp @@ -35,12 +35,12 @@ PairYukawa::PairYukawa(LAMMPS *lmp) : Pair(lmp) {} PairYukawa::~PairYukawa() { 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(a); - memory->destroy_2d_double_array(offset); + memory->destroy(cut); + memory->destroy(a); + memory->destroy(offset); } } @@ -137,16 +137,16 @@ void PairYukawa::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"); - a = memory->create_2d_double_array(n+1,n+1,"pair:a"); - offset = memory->create_2d_double_array(n+1,n+1,"pair:offset"); + memory->create(cut,n+1,n+1,"pair:cut"); + memory->create(a,n+1,n+1,"pair:a"); + memory->create(offset,n+1,n+1,"pair:offset"); } /* ---------------------------------------------------------------------- diff --git a/src/read_restart.cpp b/src/read_restart.cpp index 6c34cf896076ed534e1253267bfc11e9f579ec29..f2f16cefd20ff24368d096756673bd630202a448 100644 --- a/src/read_restart.cpp +++ b/src/read_restart.cpp @@ -140,7 +140,7 @@ void ReadRestart::command(int narg, char **arg) int nextra = modify->read_restart(fp); atom->nextra_store = nextra; - atom->extra = memory->create_2d_double_array(n,nextra,"atom:extra"); + memory->create(atom->extra,n,nextra,"atom:extra"); // single file: // nprocs_file = # of chunks in file @@ -271,9 +271,8 @@ void ReadRestart::command(int narg, char **arg) // destroy temporary fix if (nextra) { - memory->destroy_2d_double_array(atom->extra); - atom->extra = memory->create_2d_double_array(atom->nmax,nextra, - "atom:extra"); + memory->destroy(atom->extra); + memory->create(atom->extra,atom->nmax,nextra,"atom:extra"); int ifix = modify->find_fix("_read_restart"); FixReadRestart *fix = (FixReadRestart *) modify->fix[ifix]; int *count = fix->count; @@ -704,12 +703,12 @@ void ReadRestart::type_arrays() delete [] mass; } else if (flag == SHAPE) { - double **shape = - memory->create_2d_double_array(atom->ntypes+1,3,"restart:shape"); + double **shape; + memory->create(shape,atom->ntypes+1,3,"restart:shape"); if (me == 0) fread(&shape[1][0],sizeof(double),atom->ntypes*3,fp); MPI_Bcast(&shape[1][0],atom->ntypes*3,MPI_DOUBLE,0,world); atom->set_shape(shape); - memory->destroy_2d_double_array(shape); + memory->destroy(shape); } else if (flag == DIPOLE) { double *dipole = new double[atom->ntypes+1]; diff --git a/src/special.cpp b/src/special.cpp index e58eaea4e38094f1298451b9a925b23a5beeb940..e0ec4ce3179f25d4bf77b177b9375d1faf57240a 100644 --- a/src/special.cpp +++ b/src/special.cpp @@ -39,9 +39,9 @@ Special::Special(LAMMPS *lmp) : Pointers(lmp) Special::~Special() { - memory->destroy_2d_int_array(onetwo); - memory->destroy_2d_int_array(onethree); - memory->destroy_2d_int_array(onefour); + memory->destroy(onetwo); + memory->destroy(onethree); + memory->destroy(onefour); } /* ---------------------------------------------------------------------- @@ -152,7 +152,7 @@ void Special::build() if (logfile) fprintf(logfile," %d = max # of 1-2 neighbors\n",maxall); } - onetwo = memory->create_2d_int_array(nlocal,maxall,"special:onetwo"); + memory->create(onetwo,nlocal,maxall,"special:onetwo"); // count = accumulating counter @@ -303,7 +303,7 @@ void Special::build() if (logfile) fprintf(logfile," %d = max # of 1-3 neighbors\n",maxall); } - onethree = memory->create_2d_int_array(nlocal,maxall,"special:onethree"); + memory->create(onethree,nlocal,maxall,"special:onethree"); // nbufmax = largest buffer needed to hold info from any proc // info for each atom = 4 scalars + list of 1-2 neighs + list of 1-3 neighs @@ -470,7 +470,7 @@ void Special::build() if (logfile) fprintf(logfile," %d = max # of 1-4 neighbors\n",maxall); } - onefour = memory->create_2d_int_array(nlocal,maxall,"special:onefour"); + memory->create(onefour,nlocal,maxall,"special:onefour"); // nbufmax = largest buffer needed to hold info from any proc // info for each atom = 3 scalars + list of 1-3 neighs + list of 1-4 neighs @@ -637,10 +637,9 @@ void Special::combine() fprintf(logfile," %d = max # of special neighbors\n",atom->maxspecial); } - memory->destroy_2d_int_array(atom->special); + memory->destroy(atom->special); - atom->special = - memory->create_2d_int_array(atom->nmax,atom->maxspecial,"atom:special"); + memory->create(atom->special,atom->nmax,atom->maxspecial,"atom:special"); atom->avec->grow_reset(); int **special = atom->special; @@ -747,8 +746,8 @@ void Special::angle_trim() int maxcount = 0; for (i = 0; i < nlocal; i++) maxcount = MAX(maxcount,nspecial[i][1]-nspecial[i][0]); - int **dflag = - memory->create_2d_int_array(nlocal,maxcount,"special::dflag"); + int **dflag; + memory->create(dflag,nlocal,maxcount,"special::dflag"); for (i = 0; i < nlocal; i++) { n = nspecial[i][1] - nspecial[i][0]; @@ -842,7 +841,7 @@ void Special::angle_trim() // clean up - memory->destroy_2d_int_array(dflag); + memory->destroy(dflag); delete [] buf; delete [] bufcopy; @@ -922,8 +921,8 @@ void Special::dihedral_trim() int maxcount = 0; for (i = 0; i < nlocal; i++) maxcount = MAX(maxcount,nspecial[i][2]-nspecial[i][1]); - int **dflag = - memory->create_2d_int_array(nlocal,maxcount,"special::dflag"); + int **dflag; + memory->create(dflag,nlocal,maxcount,"special::dflag"); for (i = 0; i < nlocal; i++) { n = nspecial[i][2] - nspecial[i][1]; @@ -1003,7 +1002,7 @@ void Special::dihedral_trim() // clean up - memory->destroy_2d_int_array(dflag); + memory->destroy(dflag); delete [] buf; delete [] bufcopy; diff --git a/src/velocity.cpp b/src/velocity.cpp index efef0c9653cf4aef4c22f334b85600910d3e3e87..7a8505faa722cad8a4280be72bcaedf15ea032a7 100644 --- a/src/velocity.cpp +++ b/src/velocity.cpp @@ -164,7 +164,8 @@ void Velocity::create(double t_desired, int seed) double **v = atom->v; int nlocal = atom->nlocal; - double **vhold = memory->create_2d_double_array(nlocal,3,"velocity:vnew"); + double **vhold; + memory->create(vhold,nlocal,3,"velocity:vnew"); for (i = 0; i < nlocal; i++) { vhold[i][0] = v[i][0]; @@ -332,7 +333,7 @@ void Velocity::create(double t_desired, int seed) // free local memory // if temperature was created, delete it - memory->destroy_2d_double_array(vhold); + memory->destroy(vhold); delete random; if (tflag) delete temperature; } @@ -437,8 +438,7 @@ void Velocity::set(int narg, char **arg) // allocate vfield array if necessary double **vfield = NULL; - if (varflag == ATOM) - vfield = memory->create_2d_double_array(atom->nlocal,3,"velocity:vfield"); + if (varflag == ATOM) memory->create(vfield,atom->nlocal,3,"velocity:vfield"); // set velocities via constants @@ -499,7 +499,7 @@ void Velocity::set(int narg, char **arg) delete [] xstr; delete [] ystr; delete [] zstr; - memory->destroy_2d_double_array(vfield); + memory->destroy(vfield); } /* ----------------------------------------------------------------------