From fbb475b9cd1a89004a5a96da25afc1c802478ecf Mon Sep 17 00:00:00 2001 From: sjplimp <sjplimp@f3b2605a-c512-4ea7-a41b-209d697bcdaa> Date: Fri, 25 Mar 2011 21:13:51 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5835 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/ASPHERE/atom_vec_ellipsoid.cpp | 4 +- src/ASPHERE/compute_erotate_asphere.cpp | 5 +- src/ASPHERE/compute_temp_asphere.cpp | 5 +- src/ASPHERE/fix_nh_asphere.cpp | 5 +- src/ASPHERE/fix_nve_asphere.cpp | 5 +- src/ASPHERE/pair_gayberne.cpp | 56 ++++---- src/ASPHERE/pair_resquared.cpp | 56 ++++---- src/CLASS2/pair_lj_class2.cpp | 42 +++--- src/CLASS2/pair_lj_class2_coul_cut.cpp | 56 ++++---- src/CLASS2/pair_lj_class2_coul_long.cpp | 48 +++---- src/COLLOID/atom_vec_colloid.cpp | 4 +- src/COLLOID/pair_colloid.cpp | 76 +++++----- src/COLLOID/pair_lubricate.cpp | 16 +-- src/DIPOLE/atom_vec_dipole.cpp | 4 +- src/DIPOLE/pair_dipole_cut.cpp | 56 ++++---- src/DSMC/pair_dsmc.cpp | 40 +++--- src/GRANULAR/atom_vec_granular.cpp | 4 +- src/GRANULAR/fix_pour.cpp | 11 +- src/GRANULAR/fix_wall_gran.cpp | 4 +- src/GRANULAR/pair_gran_hooke_history.cpp | 8 +- src/KSPACE/ewald.cpp | 18 +-- src/KSPACE/pair_born_coul_long.cpp | 60 ++++---- src/KSPACE/pair_buck_coul_long.cpp | 48 +++---- src/KSPACE/pair_coul_long.cpp | 12 +- src/KSPACE/pair_lj_charmm_coul_long.cpp | 60 ++++---- src/KSPACE/pair_lj_cut_coul_long.cpp | 48 +++---- src/KSPACE/pppm.cpp | 29 ++-- src/MANYBODY/pair_airebo.cpp | 34 ++--- src/MANYBODY/pair_comb.cpp | 50 +++---- src/MANYBODY/pair_eam.cpp | 40 +++--- src/MANYBODY/pair_eam_alloy.cpp | 26 ++-- src/MANYBODY/pair_eam_fs.cpp | 16 +-- src/MANYBODY/pair_eim.cpp | 48 +++---- src/MANYBODY/pair_sw.cpp | 8 +- src/MANYBODY/pair_tersoff.cpp | 8 +- src/MEAM/pair_meam.cpp | 44 +++--- src/MOLECULE/angle_hybrid.cpp | 9 +- src/MOLECULE/atom_vec_angle.cpp | 4 +- src/MOLECULE/atom_vec_bond.cpp | 4 +- src/MOLECULE/atom_vec_full.cpp | 4 +- src/MOLECULE/atom_vec_molecular.cpp | 4 +- src/MOLECULE/dihedral_hybrid.cpp | 9 +- src/MOLECULE/improper_hybrid.cpp | 9 +- src/MOLECULE/pair_hbond_dreiding_lj.cpp | 8 +- src/MOLECULE/pair_lj_charmm_coul_charmm.cpp | 60 ++++---- src/PERI/atom_vec_peri.cpp | 4 +- src/PERI/fix_peri_neigh.cpp | 13 +- src/PERI/pair_peri_lps.cpp | 29 ++-- src/PERI/pair_peri_pmb.cpp | 24 ++-- src/POEMS/fix_poems.cpp | 96 ++++++------- src/REAX/pair_reax.cpp | 8 +- src/REPLICA/fix_event.cpp | 12 +- src/REPLICA/fix_neb.cpp | 18 +-- src/REPLICA/neb.cpp | 4 +- src/REPLICA/prd.cpp | 4 +- src/SRD/fix_srd.cpp | 12 +- src/SRD/fix_wall_srd.cpp | 8 +- src/USER-CG-CMM/pair_cg_cmm_coul_cut.cpp | 16 +-- src/USER-CG-CMM/pair_cg_cmm_coul_long.cpp | 16 +-- src/USER-CG-CMM/pair_cmm_common.cpp | 44 +++--- src/USER-EFF/atom_vec_electron.cpp | 4 +- src/USER-EFF/compute_temp_deform_eff.cpp | 7 +- src/USER-EFF/compute_temp_region_eff.cpp | 7 +- src/USER-EFF/fix_langevin_eff.cpp | 4 +- src/USER-EFF/pair_eff_cut.cpp | 12 +- src/USER-EWALDN/pair_buck_coul.cpp | 64 ++++----- src/USER-EWALDN/pair_lj_coul.cpp | 60 ++++---- src/USER-REAXC/fix_qeq_reax.cpp | 12 +- src/USER-REAXC/pair_reax_c.cpp | 8 +- src/angle.cpp | 6 +- src/atom_vec_atomic.cpp | 4 +- src/atom_vec_charge.cpp | 4 +- src/atom_vec_hybrid.cpp | 4 +- src/bond.cpp | 6 +- src/bond_hybrid.cpp | 9 +- src/compute_angle_local.cpp | 7 +- src/compute_atom_molecule.cpp | 10 +- src/compute_bond_local.cpp | 7 +- src/compute_cna_atom.cpp | 6 +- src/compute_com_molecule.cpp | 8 +- src/compute_dihedral_local.cpp | 7 +- src/compute_displace_atom.cpp | 7 +- src/compute_gyration_molecule.cpp | 9 +- src/compute_improper_local.cpp | 7 +- src/compute_msd_molecule.cpp | 17 ++- src/compute_pair_local.cpp | 7 +- src/compute_property_atom.cpp | 7 +- src/compute_property_local.cpp | 13 +- src/compute_property_molecule.cpp | 5 +- src/compute_rdf.cpp | 14 +- src/compute_stress_atom.cpp | 7 +- src/compute_temp_deform.cpp | 7 +- src/compute_temp_partial.cpp | 7 +- src/compute_temp_profile.cpp | 16 +-- src/compute_temp_ramp.cpp | 7 +- src/compute_temp_region.cpp | 7 +- src/dihedral.cpp | 6 +- src/dump_cfg.cpp | 6 +- src/fix.cpp | 6 +- src/fix_adapt.cpp | 8 +- src/fix_addforce.cpp | 6 +- src/fix_ave_atom.cpp | 5 +- src/fix_ave_correlate.cpp | 15 +- src/fix_ave_histo.cpp | 10 +- src/fix_ave_spatial.cpp | 31 ++--- src/fix_ave_time.cpp | 12 +- src/fix_efield.cpp | 6 +- src/fix_external.cpp | 6 +- src/fix_langevin.cpp | 6 +- src/fix_move.cpp | 17 ++- src/fix_orient_fcc.cpp | 8 +- src/fix_read_restart.cpp | 5 +- src/fix_rigid.cpp | 87 ++++++------ src/fix_rigid_nve.cpp | 4 +- src/fix_rigid_nvt.cpp | 4 +- src/fix_setforce.cpp | 6 +- src/fix_shake.cpp | 53 +++---- src/fix_shear_history.cpp | 5 +- src/fix_spring_self.cpp | 5 +- src/fix_store_force.cpp | 8 +- src/fix_store_state.cpp | 5 +- src/fix_tmd.cpp | 8 +- src/fix_ttm.cpp | 4 +- src/improper.cpp | 6 +- src/lattice.cpp | 4 +- src/memory.cpp | 146 -------------------- src/memory.h | 15 -- src/pair.cpp | 6 +- src/pair_born.cpp | 56 ++++---- src/pair_buck.cpp | 42 +++--- src/pair_buck_coul_cut.cpp | 57 ++++---- src/pair_coul_cut.cpp | 16 +-- src/pair_dpd.cpp | 24 ++-- src/pair_gauss.cpp | 24 ++-- src/pair_hybrid.cpp | 30 ++-- src/pair_lj96_cut.cpp | 42 +++--- src/pair_lj_cut.cpp | 42 +++--- src/pair_lj_cut_coul_cut.cpp | 56 ++++---- src/pair_lj_expand.cpp | 48 +++---- src/pair_lj_gromacs.cpp | 68 ++++----- src/pair_lj_gromacs_coul_gromacs.cpp | 56 ++++---- src/pair_lj_smooth.cpp | 72 +++++----- src/pair_morse.cpp | 34 ++--- src/pair_soft.cpp | 16 +-- src/pair_table.cpp | 18 +-- src/pair_yukawa.cpp | 20 +-- src/read_restart.cpp | 13 +- src/special.cpp | 29 ++-- src/velocity.cpp | 10 +- 149 files changed, 1450 insertions(+), 1708 deletions(-) diff --git a/src/ASPHERE/atom_vec_ellipsoid.cpp b/src/ASPHERE/atom_vec_ellipsoid.cpp index 9a0b7d735f..4ddbef607c 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 91e404486b..b7c6302eba 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 8f4af98aba..3a0ccbee4a 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 224d25f7e2..ddf5d1b8db 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 11152cf66b..4ddf05081d 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 ff8c835e12..aa0d0c2a72 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 2f12d864d3..4be78b42d6 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 77c66200d1..9b6f41893f 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 b6a16883c1..8c8dc7e228 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 1344dfb7e7..f714d1cc85 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 001a8c8637..2f71e33472 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 7af1410ed8..8bd67abfac 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 b708794ded..43ec4031ec 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 18985e8bb4..d033175301 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 bb8995e848..20fc4076d0 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 090f2af796..b04dd8f6d7 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 652ea57bf7..e934796f61 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 0f54bbf79b..73b9d49914 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 5331ce1f6f..4b60f96714 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 3127621fef..fbf7043098 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 24719646dc..ad7a5923ec 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 b1505a3af6..493071bcbe 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 800900cdc2..1cf9d0a49d 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 65ef65d07d..b49d44a0d0 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 66f84440f2..d8b2b1c487 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 74056b96c5..cff7bf5df8 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 2306528fed..ab211f3d3a 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 28b2721212..16fa7e80c1 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 7d462af082..c1ed538380 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 02c33f6b5a..464d424976 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 ab45bccb2d..894ab07922 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 15059ad39a..332d78f2ce 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 c8e25c31c7..a7e4400ea3 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 6c22f645a3..3f18b6ff3d 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 f21ff4e918..4cdb135735 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 2f89c0694e..e26ee6c1e0 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 ba9ed9ee96..183366b63e 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 6b2adfbdfa..54c5cc6746 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 451e6ff87c..5900aa4609 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 26b2e99f82..8261b4317e 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 ec039b7be2..84bfa9f27a 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 dde226fae2..4ca0fd99d6 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 4e83f8b5b7..01b9fc7bc5 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 c6d2438373..b97e2969c1 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 1326d3ecd3..b8f2ffa62d 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 23be75893a..68110b329c 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 3178e31d3e..3b2cf8642d 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 fc92015c16..db7d67791e 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 afb1f017a8..29739f5bd6 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 f4edb3f1cf..b928dcfcf2 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 5553293cca..73dd8de20d 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 0cbbb91e89..44818c9a38 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 6d9074964f..ad27e54dd9 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 a46f84d622..4c4fc35633 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 84d7112705..c433370d7a 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 d7ec560fa0..4892c42467 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 9c8eb4ce5a..2f18d28837 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 fa9a8d25cd..87b9db2ba8 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 b001981f7d..441528c8ff 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 0198a09231..fb8bf72a82 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 c54fa8cbb4..4c4e1d1c3a 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 5001e03773..41430e5b4e 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 58af7098be..8b1ac402c7 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 45b9eba0f7..81cfbbc589 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 fd60f675c6..63ca79d3b6 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 4bb7872573..8909c19167 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 d2b84beb26..0a5190525c 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 640f102459..913919f558 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 f30a82873f..340cf804cf 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 df8a80e22f..2884dd7ac4 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 9a814dda82..0b5d36d15c 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 85ff93d2b0..e2f6ac4c03 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 3e2cdac656..0a64c99ba2 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 6551297f46..e30ebdc73d 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 a373248dad..d177f716c2 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 b03bf40045..7a7ebf978b 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 5972da184e..00fb93295b 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 379ee5662f..c012bed3a6 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 4416671d5c..0e8df48723 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 3323692469..235e6c3c25 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 a8f2eddc50..94563588e8 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 9c5112c944..fbd828be5d 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 e5dfee9966..d0dd1b77b6 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 00153b66ac..0f22206b42 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 ca9f099ff1..7f49857719 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 cbb779b6c1..53f21ae742 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 4447d9f06f..1e2137e171 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 d7c814eafb..745a09af5e 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 16c30ab855..de73b3b52f 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 c4fef5a6b3..04848b3923 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 62d7799f13..b17d4fc6a2 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 a03e74e85e..665f904fdb 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 6480593191..96fd04037c 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 6d3bb452a4..f15089c833 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 b9e6cdff9a..1690e1224c 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 c297b85d95..b43af45de3 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 8f8c700e08..0adfd295e0 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 1635252f18..4580e4ad6d 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 2466be2d9f..e2c077fbc4 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 ac7797207e..7fb769df90 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 b51b2dcc0d..34f9adb166 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 cde0a62f61..d69edf87a2 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 4660662e04..4fedfc6a74 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 b5f94b3e7b..ce9eac4848 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 0bb843de25..52f6686815 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 5b852750cf..aaeb4b543c 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 90bf8cbacc..78eca23a81 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 3bbc92fda6..449a6d07c9 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 7c7e157d26..ae2cb4f2e5 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 43f5df7d24..5108793cf5 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 c7b891ee99..a64acd73a5 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 3ed607d683..f0a154578b 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 6a78eedd9a..3003ae7774 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 e5a06a89ba..f99a20ff71 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 0f16ca1980..34f83de9ee 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 0f137e87db..18ab22ae7d 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 83ff409112..5925231173 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 16ed40dad2..9c8285e84e 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 b28807f1f1..c36092c3f3 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 820ea0729e..6af760c9d9 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 3ca6082867..5dc2746839 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 496b508619..b2dfd90138 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 2379730140..9dfebc91a6 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 8697d9f722..c68d088294 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 5a7ba060c1..48e749834c 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 cf8f5eb4c6..e6d64df0cd 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 c90dff2d86..f8d0eaa6c1 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 da81910642..333e03789c 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 13194d43b0..ba9953d8b1 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 8d02aa2b84..6b91e23056 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 4d57d22186..9fa00e13b6 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 f361f0ad9a..cc92998f02 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 fe38c86923..6a42decede 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 f59c3ad270..ad3d15f4ae 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 3b2e3ae9aa..786eb674fd 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 f34551abd2..03b9a4455b 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 9084ec0182..2c36c5401e 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 4cf101a0c4..c55c50ea6a 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 6ea9d7692e..7f255258d1 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 6fb2786b08..b2c567d949 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 f5e49a5167..83332d9dc5 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 ce67ce482a..d49a23bbfb 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 61a3ba1b4e..d01e227fac 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 e9e6bd0d8e..c58290e35e 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 74f01659d6..f9af94bdec 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 6ee2169776..b755aefb6e 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 6c34cf8960..f2f16cefd2 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 e58eaea4e3..e0ec4ce317 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 efef0c9653..7a8505faa7 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); } /* ---------------------------------------------------------------------- -- GitLab