Merge branch 'master' into prepare-clang-format
# Conflicts: # src/KOKKOS/nbin_kokkos.h # src/KOKKOS/nbin_ssa_kokkos.h # src/MOLECULE/bond_fene_expand.h # src/USER-DPD/nbin_ssa.h # src/USER-DPD/nstencil_half_bin_2d_ssa.h # src/USER-DPD/nstencil_half_bin_3d_ssa.h # src/USER-INTEL/nbin_intel.h # src/USER-MISC/fix_propel_self.cpp # src/USER-OMP/npair_full_multi_old_omp.h # src/USER-OMP/npair_half_multi_old_newton_omp.h # src/USER-OMP/npair_half_size_multi_newtoff_omp.h # src/USER-OMP/npair_halffull_newtoff_omp.h # src/USER-OMP/npair_halffull_newton_omp.h # src/USER-OMP/npair_skip_omp.h # src/main.cpp # src/nbin_standard.h # src/npair_full_multi_old.h # src/npair_halffull_newtoff.h # src/npair_halffull_newton.h # src/npair_skip.h # src/npair_skip_respa.h # src/npair_skip_size.h # src/npair_skip_size_off2on.h # src/npair_skip_size_off2on_oneside.h # src/nstencil_full_bin_2d.h # src/nstencil_full_bin_3d.h # src/nstencil_full_ghost_bin_2d.h # src/nstencil_full_ghost_bin_3d.h # src/nstencil_full_multi_2d.h # src/nstencil_full_multi_3d.h # src/nstencil_full_multi_old_2d.h # src/nstencil_full_multi_old_3d.h # src/nstencil_half_bin_2d_newtoff.cpp # src/nstencil_half_bin_3d_newtoff.cpp # src/nstencil_half_bin_3d_newton_tri.h # src/nstencil_half_ghost_bin_2d_newtoff.cpp # src/nstencil_half_ghost_bin_2d_newtoff.h # src/nstencil_half_ghost_bin_3d_newtoff.cpp # src/nstencil_half_ghost_bin_3d_newtoff.h # src/nstencil_half_multi_2d.h # src/nstencil_half_multi_2d_newtoff.h # src/nstencil_half_multi_2d_newton_tri.h # src/nstencil_half_multi_2d_tri.h # src/nstencil_half_multi_3d_newtoff.h # src/nstencil_half_multi_3d_newton_tri.h
This commit is contained in:
@ -20,6 +20,7 @@
|
||||
#include "comm.h"
|
||||
#include "update.h"
|
||||
#include "error.h"
|
||||
#include "memory.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
@ -30,6 +31,33 @@ using namespace LAMMPS_NS;
|
||||
|
||||
NBinStandard::NBinStandard(LAMMPS *lmp) : NBin(lmp) {}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
setup for bin_atoms()
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void NBinStandard::bin_atoms_setup(int nall)
|
||||
{
|
||||
// binhead = per-bin vector, mbins in length
|
||||
// add 1 bin for USER-INTEL package
|
||||
|
||||
if (mbins > maxbin) {
|
||||
maxbin = mbins;
|
||||
memory->destroy(binhead);
|
||||
memory->create(binhead,maxbin,"neigh:binhead");
|
||||
}
|
||||
|
||||
// bins and atom2bin = per-atom vectors
|
||||
// for both local and ghost atoms
|
||||
|
||||
if (nall > maxatom) {
|
||||
maxatom = nall;
|
||||
memory->destroy(bins);
|
||||
memory->create(bins,maxatom,"neigh:bins");
|
||||
memory->destroy(atom2bin);
|
||||
memory->create(atom2bin,maxatom,"neigh:atom2bin");
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
setup neighbor binning geometry
|
||||
bin numbering in each dimension is global:
|
||||
@ -88,7 +116,7 @@ void NBinStandard::setup_bins(int style)
|
||||
|
||||
// optimal bin size is roughly 1/2 the cutoff
|
||||
// for BIN style, binsize = 1/2 of max neighbor cutoff
|
||||
// for MULTI style, binsize = 1/2 of min neighbor cutoff
|
||||
// for MULTI_OLD style, binsize = 1/2 of min neighbor cutoff
|
||||
// special case of all cutoffs = 0.0, binsize = box size
|
||||
|
||||
double binsize_optimal;
|
||||
@ -231,3 +259,13 @@ void NBinStandard::bin_atoms()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
double NBinStandard::memory_usage()
|
||||
{
|
||||
double bytes = 0;
|
||||
bytes += (double)maxbin*sizeof(int);
|
||||
bytes += (double)2*maxatom*sizeof(int);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user