use qualified auto
This commit is contained in:
@ -88,7 +88,7 @@ void AtomVecPeri::grow_pointers()
|
||||
|
||||
void AtomVecPeri::create_atom_post(int ilocal)
|
||||
{
|
||||
const auto xinit = atom->x;
|
||||
auto *const xinit = atom->x;
|
||||
vfrac[ilocal] = 1.0;
|
||||
rmass[ilocal] = 1.0;
|
||||
s0[ilocal] = DBL_MAX;
|
||||
@ -104,7 +104,7 @@ void AtomVecPeri::create_atom_post(int ilocal)
|
||||
|
||||
void AtomVecPeri::data_atom_post(int ilocal)
|
||||
{
|
||||
const auto xinit = atom->x;
|
||||
auto *const xinit = atom->x;
|
||||
s0[ilocal] = DBL_MAX;
|
||||
x0[ilocal][0] = xinit[ilocal][0];
|
||||
x0[ilocal][1] = xinit[ilocal][1];
|
||||
|
||||
@ -82,8 +82,8 @@ void ComputeDilatationAtom::compute_peratom()
|
||||
// extract dilatation for each atom in group
|
||||
|
||||
int tmp;
|
||||
auto anypair = force->pair_match("^peri",0);
|
||||
auto theta = (double *)anypair->extract("theta",tmp);
|
||||
auto *anypair = force->pair_match("^peri",0);
|
||||
auto *theta = (double *)anypair->extract("theta",tmp);
|
||||
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
@ -561,7 +561,7 @@ void FixPeriNeigh::write_restart(FILE *fp)
|
||||
void FixPeriNeigh::restart(char *buf)
|
||||
{
|
||||
int n = 0;
|
||||
auto list = (double *) buf;
|
||||
auto *list = (double *) buf;
|
||||
|
||||
first = static_cast<int> (list[n++]);
|
||||
maxpartner = static_cast<int> (list[n++]);
|
||||
|
||||
@ -269,11 +269,11 @@ void DynamicalMatrix::calculateMatrix()
|
||||
double *m = atom->mass;
|
||||
double **f = atom->f;
|
||||
|
||||
auto dynmat = new double*[3];
|
||||
auto *dynmat = new double*[3];
|
||||
for (int i=0; i<3; i++)
|
||||
dynmat[i] = new double[dynlenb];
|
||||
|
||||
auto fdynmat = new double*[3];
|
||||
auto *fdynmat = new double*[3];
|
||||
for (int i=0; i<3; i++)
|
||||
fdynmat[i] = new double[dynlenb];
|
||||
|
||||
@ -574,7 +574,7 @@ void DynamicalMatrix::create_groupmap()
|
||||
bigint natoms = atom->natoms;
|
||||
int *recv = new int[comm->nprocs];
|
||||
int *displs = new int[comm->nprocs];
|
||||
auto temp_groupmap = new bigint[natoms];
|
||||
auto *temp_groupmap = new bigint[natoms];
|
||||
|
||||
//find number of local atoms in the group (final_gid)
|
||||
for (bigint i=1; i<=natoms; i++) {
|
||||
@ -583,7 +583,7 @@ void DynamicalMatrix::create_groupmap()
|
||||
gid += 1; // gid at the end of loop is final_Gid
|
||||
}
|
||||
//create an array of length final_gid
|
||||
auto sub_groupmap = new bigint[gid];
|
||||
auto *sub_groupmap = new bigint[gid];
|
||||
|
||||
gid = 0;
|
||||
//create a map between global atom id and group atom id for each proc
|
||||
|
||||
@ -672,7 +672,7 @@ void FixPhonon::postprocess( )
|
||||
|
||||
// to get Phi = KT.G^-1; normalization of FFTW data is done here
|
||||
double boltz = force->boltz, TempAve = 0.;
|
||||
auto kbtsqrt = new double[sysdim];
|
||||
auto *kbtsqrt = new double[sysdim];
|
||||
double TempFac = inv_neval * inv_nTemp;
|
||||
double NormFac = TempFac * double(ntotal);
|
||||
|
||||
@ -696,7 +696,7 @@ void FixPhonon::postprocess( )
|
||||
MPI_Gatherv(Phi_q[0],mynq*fft_dim2*2,MPI_DOUBLE,Phi_all[0],recvcnts,displs,MPI_DOUBLE,0,world);
|
||||
|
||||
// to collect all basis info and averaged it on root
|
||||
auto basis_root = new double[fft_dim];
|
||||
auto *basis_root = new double[fft_dim];
|
||||
if (fft_dim > sysdim) MPI_Reduce(&basis[1][0], &basis_root[sysdim], fft_dim-sysdim, MPI_DOUBLE, MPI_SUM, 0, world);
|
||||
|
||||
if (me == 0) { // output dynamic matrix by root
|
||||
|
||||
@ -286,8 +286,8 @@ void ThirdOrder::calculateMatrix()
|
||||
bigint j;
|
||||
bigint *firstneigh;
|
||||
|
||||
auto dynmat = new double[dynlenb];
|
||||
auto fdynmat = new double[dynlenb];
|
||||
auto *dynmat = new double[dynlenb];
|
||||
auto *fdynmat = new double[dynlenb];
|
||||
memset(&dynmat[0],0,dynlenb*sizeof(double));
|
||||
memset(&fdynmat[0],0,dynlenb*sizeof(double));
|
||||
|
||||
@ -618,7 +618,7 @@ void ThirdOrder::create_groupmap()
|
||||
bigint natoms = atom->natoms;
|
||||
int *recv = new int[comm->nprocs];
|
||||
int *displs = new int[comm->nprocs];
|
||||
auto temp_groupmap = new bigint[natoms];
|
||||
auto *temp_groupmap = new bigint[natoms];
|
||||
|
||||
//find number of local atoms in the group (final_gid)
|
||||
for (bigint i=1; i<=natoms; i++) {
|
||||
@ -627,7 +627,7 @@ void ThirdOrder::create_groupmap()
|
||||
gid += 1; // gid at the end of loop is final_Gid
|
||||
}
|
||||
//create an array of length final_gid
|
||||
auto sub_groupmap = new bigint[gid];
|
||||
auto *sub_groupmap = new bigint[gid];
|
||||
|
||||
gid = 0;
|
||||
//create a map between global atom id and group atom id for each proc
|
||||
@ -715,8 +715,8 @@ void ThirdOrder::getNeighbortags() {
|
||||
}
|
||||
|
||||
bigint nbytes = ((bigint) sizeof(bigint)) * sum;
|
||||
auto data = (bigint *) memory->smalloc(nbytes, "thirdorder:firsttags");
|
||||
auto datarecv = (bigint *) memory->smalloc(nbytes, "thirdorder:neighbortags");
|
||||
auto *data = (bigint *) memory->smalloc(nbytes, "thirdorder:firsttags");
|
||||
auto *datarecv = (bigint *) memory->smalloc(nbytes, "thirdorder:neighbortags");
|
||||
nbytes = ((bigint) sizeof(bigint *)) * natoms;
|
||||
firsttags = (bigint **) memory->smalloc(nbytes, "thirdorder:firsttags");
|
||||
neighbortags = (bigint **) memory->smalloc(nbytes, "thirdorder:neighbortags");
|
||||
|
||||
@ -354,7 +354,7 @@ void FixPOEMS::init()
|
||||
|
||||
if (earlyflag) {
|
||||
bool pflag = false;
|
||||
for (auto &ifix : modify->get_fix_list()) {
|
||||
for (const auto &ifix : modify->get_fix_list()) {
|
||||
if (utils::strmatch(ifix->style, "^poems")) pflag = true;
|
||||
if (pflag && (ifix->setmask() & POST_FORCE) && !ifix->rigid_flag)
|
||||
if (comm->me == 0)
|
||||
@ -365,7 +365,7 @@ void FixPOEMS::init()
|
||||
|
||||
// error if npt,nph fix comes before rigid fix
|
||||
bool pflag = false;
|
||||
for (auto &ifix : modify->get_fix_list()) {
|
||||
for (const auto &ifix : modify->get_fix_list()) {
|
||||
if (!pflag && utils::strmatch(ifix->style, "np[th]"))
|
||||
error->all(FLERR, "POEMS fix must come before NPT/NPH fix");
|
||||
if (utils::strmatch(ifix->style, "^poems")) pflag = true;
|
||||
@ -942,7 +942,7 @@ void FixPOEMS::readfile(const char *file)
|
||||
nbody = bodies.size();
|
||||
MPI_Bcast(&nbody, 1, MPI_INT, 0, world);
|
||||
MPI_Bcast(&maxbody, 1, MPI_INT, 0, world);
|
||||
bigint *buf = new bigint[maxbody + 1];
|
||||
auto *buf = new bigint[maxbody + 1];
|
||||
const int nlocal = atom->nlocal;
|
||||
|
||||
for (int i = 0; i < nbody; ++i) {
|
||||
|
||||
@ -125,7 +125,7 @@ ComputePTMAtom::ComputePTMAtom(LAMMPS *lmp, int narg, char **arg)
|
||||
if (rmsd_threshold == 0)
|
||||
rmsd_threshold = INFINITY;
|
||||
|
||||
auto group_name = (char *)"all";
|
||||
auto * group_name = (char *)"all";
|
||||
if (narg > 5) {
|
||||
group_name = arg[5];
|
||||
}
|
||||
@ -191,7 +191,7 @@ static bool sorthelper_compare(ptmnbr_t const &a, ptmnbr_t const &b) {
|
||||
|
||||
static int get_neighbours(void* vdata, size_t central_index, size_t atom_index, int num, size_t* nbr_indices, int32_t* numbers, double (*nbr_pos)[3])
|
||||
{
|
||||
auto data = (ptmnbrdata_t*)vdata;
|
||||
auto * data = (ptmnbrdata_t*)vdata;
|
||||
int *mask = data->mask;
|
||||
int group2bit = data->group2bit;
|
||||
|
||||
|
||||
@ -179,7 +179,7 @@ static int _calculate_neighbour_ordering(void* _voronoi_handle, int num_points,
|
||||
{
|
||||
assert(num_points <= PTM_MAX_INPUT_POINTS);
|
||||
|
||||
auto voronoi_handle = (ptm_voro::voronoicell_neighbor*)_voronoi_handle;
|
||||
auto * voronoi_handle = (ptm_voro::voronoicell_neighbor*)_voronoi_handle;
|
||||
|
||||
double max_norm = 0;
|
||||
double points[PTM_MAX_INPUT_POINTS][3];
|
||||
@ -277,13 +277,13 @@ static int find_diamond_neighbours(void* _voronoi_handle, int num_points, double
|
||||
|
||||
void* voronoi_initialize_local()
|
||||
{
|
||||
auto ptr = new ptm_voro::voronoicell_neighbor;
|
||||
auto * ptr = new ptm_voro::voronoicell_neighbor;
|
||||
return (void*)ptr;
|
||||
}
|
||||
|
||||
void voronoi_uninitialize_local(void* _ptr)
|
||||
{
|
||||
auto ptr = (ptm_voro::voronoicell_neighbor*)_ptr;
|
||||
auto * ptr = (ptm_voro::voronoicell_neighbor*)_ptr;
|
||||
delete ptr;
|
||||
}
|
||||
|
||||
|
||||
@ -106,7 +106,7 @@ void PairPython::compute(int eflag, int vflag)
|
||||
// prepare access to compute_force and compute_energy functions
|
||||
|
||||
PyUtils::GIL lock;
|
||||
auto py_pair_instance = (PyObject *) py_potential;
|
||||
auto *py_pair_instance = (PyObject *) py_potential;
|
||||
PyObject *py_compute_force = PyObject_GetAttrString(py_pair_instance,"compute_force");
|
||||
if (!py_compute_force) {
|
||||
PyUtils::Print_Errors();
|
||||
@ -347,8 +347,8 @@ double PairPython::single(int /* i */, int /* j */, int itype, int jtype,
|
||||
// prepare access to compute_force and compute_energy functions
|
||||
|
||||
PyUtils::GIL lock;
|
||||
auto py_compute_force = (PyObject *) get_member_function("compute_force");
|
||||
auto py_compute_energy = (PyObject *) get_member_function("compute_energy");
|
||||
auto *py_compute_force = (PyObject *) get_member_function("compute_force");
|
||||
auto *py_compute_energy = (PyObject *) get_member_function("compute_energy");
|
||||
PyObject *py_compute_args = Py_BuildValue("(dii)", rsq, itype, jtype);
|
||||
|
||||
if (!py_compute_args) {
|
||||
@ -383,7 +383,7 @@ double PairPython::single(int /* i */, int /* j */, int itype, int jtype,
|
||||
void * PairPython::get_member_function(const char * name)
|
||||
{
|
||||
PyUtils::GIL lock;
|
||||
auto py_pair_instance = (PyObject *) py_potential;
|
||||
auto *py_pair_instance = (PyObject *) py_potential;
|
||||
PyObject * py_mfunc = PyObject_GetAttrString(py_pair_instance, name);
|
||||
if (!py_mfunc) {
|
||||
PyUtils::Print_Errors();
|
||||
|
||||
@ -315,7 +315,7 @@ void PythonImpl::command(int narg, char **arg)
|
||||
|
||||
// pFunc = function object for requested function
|
||||
|
||||
auto pModule = (PyObject *) pyMain;
|
||||
auto *pModule = (PyObject *) pyMain;
|
||||
PyObject *pFunc = PyObject_GetAttrString(pModule, pfuncs[ifunc].name);
|
||||
|
||||
if (!pFunc) {
|
||||
@ -345,7 +345,7 @@ void PythonImpl::invoke_function(int ifunc, char *result, double *dvalue)
|
||||
PyObject *pValue;
|
||||
char *str;
|
||||
|
||||
auto pFunc = (PyObject *) pfuncs[ifunc].pFunc;
|
||||
auto *pFunc = (PyObject *) pfuncs[ifunc].pFunc;
|
||||
|
||||
// create Python tuple of input arguments
|
||||
|
||||
|
||||
@ -272,7 +272,7 @@ void FixQEq::allocate_matrix()
|
||||
i = ilist[ii];
|
||||
m += numneigh[i];
|
||||
}
|
||||
bigint m_cap_big = (bigint)MAX(m * safezone, mincap * MIN_NBRS);
|
||||
auto m_cap_big = (bigint)MAX(m * safezone, mincap * MIN_NBRS);
|
||||
if (m_cap_big > MAXSMALLINT)
|
||||
error->one(FLERR,"Too many neighbors in fix {}",style);
|
||||
m_cap = m_cap_big;
|
||||
|
||||
@ -396,7 +396,7 @@ void FixQBMSST::init()
|
||||
// detect if any fix rigid exist so rigid bodies move when box is dilated
|
||||
|
||||
rfix.clear();
|
||||
for (auto &ifix : modify->get_fix_list())
|
||||
for (const auto &ifix : modify->get_fix_list())
|
||||
if (ifix->rigid_flag) rfix.push_back(ifix);
|
||||
}
|
||||
|
||||
@ -842,7 +842,7 @@ void FixQBMSST::write_restart(FILE *fp)
|
||||
void FixQBMSST::restart(char *buf)
|
||||
{
|
||||
int n = 0;
|
||||
auto list = (double *) buf;
|
||||
auto *list = (double *) buf;
|
||||
omega[direction] = list[n++];
|
||||
e0 = list[n++];
|
||||
v0 = list[n++];
|
||||
|
||||
@ -2764,7 +2764,7 @@ void FixBondReact::dedup_mega_gloves(int dedup_mode)
|
||||
// let's randomly mix up our reaction instances first
|
||||
// then we can feel okay about ignoring ones we've already deleted (or accepted)
|
||||
// based off std::shuffle
|
||||
double *temp_rxn = new double[max_natoms+cuff];
|
||||
auto *temp_rxn = new double[max_natoms+cuff];
|
||||
for (int i = dedup_size-1; i > 0; --i) { //dedup_size
|
||||
// choose random entry to swap current one with
|
||||
int k = floor(random[0]->uniform()*(i+1));
|
||||
@ -4291,7 +4291,7 @@ void FixBondReact::ReadConstraints(char *line, int myrxn)
|
||||
double tmp[MAXCONARGS];
|
||||
char **strargs,*ptr,*lptr;
|
||||
memory->create(strargs,MAXCONARGS,MAXLINE,"bond/react:strargs");
|
||||
auto constraint_type = new char[MAXLINE];
|
||||
auto *constraint_type = new char[MAXLINE];
|
||||
strcpy(constraintstr[myrxn],"("); // string for boolean constraint logic
|
||||
for (int i = 0; i < nconstraints[myrxn]; i++) {
|
||||
readline(line);
|
||||
|
||||
@ -206,7 +206,7 @@ void ComputeReaxFFAtom::compute_local()
|
||||
}
|
||||
|
||||
size_local_rows = nbonds;
|
||||
auto tag = atom->tag;
|
||||
auto *tag = atom->tag;
|
||||
|
||||
int b = 0;
|
||||
|
||||
@ -216,7 +216,7 @@ void ComputeReaxFFAtom::compute_local()
|
||||
const int numbonds = bondcount[i];
|
||||
|
||||
for (int k = 0; k < numbonds; k++) {
|
||||
auto bond = array_local[b++];
|
||||
auto *bond = array_local[b++];
|
||||
bond[0] = tag[i];
|
||||
bond[1] = neighid[i][k];
|
||||
bond[2] = abo[i][k];
|
||||
@ -237,7 +237,7 @@ void ComputeReaxFFAtom::compute_peratom()
|
||||
const int nlocal = atom->nlocal;
|
||||
|
||||
for (int i = 0; i < nlocal; ++i) {
|
||||
auto ptr = array_atom[i];
|
||||
auto *ptr = array_atom[i];
|
||||
ptr[0] = reaxff->api->workspace->total_bond_order[i];
|
||||
ptr[1] = reaxff->api->workspace->nlp[i];
|
||||
ptr[2] = bondcount[i];
|
||||
|
||||
@ -362,7 +362,7 @@ void FixQEqReaxFF::allocate_matrix()
|
||||
i = ilist[ii];
|
||||
m += numneigh[i];
|
||||
}
|
||||
bigint m_cap_big = (bigint)MAX(m * safezone, mincap * REAX_MIN_NBRS);
|
||||
auto m_cap_big = (bigint)MAX(m * safezone, mincap * REAX_MIN_NBRS);
|
||||
if (m_cap_big > MAXSMALLINT)
|
||||
error->one(FLERR, Error::NOLASTLINE, "Too many neighbors in fix {}",style);
|
||||
m_cap = m_cap_big;
|
||||
@ -1117,7 +1117,7 @@ void FixQEqReaxFF::get_chi_field()
|
||||
memset(&chi_field[0],0,atom->nmax*sizeof(double));
|
||||
if (!efield) return;
|
||||
|
||||
const auto x = (const double * const *)atom->x;
|
||||
const auto *const x = (const double * const *)atom->x;
|
||||
const int *mask = atom->mask;
|
||||
const imageint *image = atom->image;
|
||||
const int nlocal = atom->nlocal;
|
||||
|
||||
@ -47,7 +47,7 @@ void FixQEqRelReaxFF::calc_chi_eff()
|
||||
{
|
||||
memset(&chi_eff[0], 0, atom->nmax * sizeof(double));
|
||||
|
||||
const auto x = (const double *const *) atom->x;
|
||||
const auto *const x = (const double *const *) atom->x;
|
||||
const int *type = atom->type;
|
||||
|
||||
double dx, dy, dz, dist_sq, overlap, sum_n, sum_d, chia, phia, phib;
|
||||
|
||||
@ -469,7 +469,7 @@ void PairReaxFF::compute(int eflag, int vflag)
|
||||
api->system->N = atom->nlocal + atom->nghost; // mine + ghosts
|
||||
|
||||
if (api->system->acks2_flag) {
|
||||
auto ifix = modify->get_fix_by_style("^acks2/reax").front();
|
||||
auto *ifix = modify->get_fix_by_style("^acks2/reax").front();
|
||||
api->workspace->s = (dynamic_cast<FixACKS2ReaxFF*>(ifix))->get_s();
|
||||
}
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ namespace ReaxFF {
|
||||
|
||||
void DeAllocate_System(reax_system *system)
|
||||
{
|
||||
auto memory = system->mem_ptr;
|
||||
auto *memory = system->mem_ptr;
|
||||
|
||||
// deallocate the atom list
|
||||
sfree(system->my_atoms);
|
||||
@ -120,7 +120,7 @@ namespace ReaxFF {
|
||||
void Allocate_Workspace(control_params *control, storage *workspace, int total_cap)
|
||||
{
|
||||
int total_real, total_rvec;
|
||||
auto error = control->error_ptr;
|
||||
auto *error = control->error_ptr;
|
||||
|
||||
workspace->allocated = 1;
|
||||
total_real = total_cap * sizeof(double);
|
||||
@ -181,7 +181,7 @@ namespace ReaxFF {
|
||||
}
|
||||
total_hbonds_big = (LAMMPS_NS::bigint)(MAX(total_hbonds_big*saferzone, mincap*system->minhbonds));
|
||||
|
||||
auto error = system->error_ptr;
|
||||
auto *error = system->error_ptr;
|
||||
if (total_hbonds_big > MAXSMALLINT)
|
||||
error->one(FLERR,"Too many hydrogen bonds in pair reaxff");
|
||||
|
||||
@ -210,7 +210,7 @@ namespace ReaxFF {
|
||||
}
|
||||
total_bonds_big = (LAMMPS_NS::bigint)(MAX(total_bonds_big * safezone, mincap*MIN_BONDS));
|
||||
|
||||
auto error = system->error_ptr;
|
||||
auto *error = system->error_ptr;
|
||||
if (total_bonds_big > MAXSMALLINT)
|
||||
error->one(FLERR,"Too many bonds in pair reaxff");
|
||||
|
||||
@ -240,7 +240,7 @@ namespace ReaxFF {
|
||||
double safezone = system->safezone;
|
||||
double saferzone = system->saferzone;
|
||||
|
||||
auto error = system->error_ptr;
|
||||
auto *error = system->error_ptr;
|
||||
reallocate_data *wsr = &(workspace->realloc);
|
||||
|
||||
if (system->n >= DANGER_ZONE * system->local_cap)
|
||||
|
||||
@ -67,7 +67,7 @@ namespace ReaxFF {
|
||||
|
||||
void Read_Control_File(const char *control_file, control_params *control)
|
||||
{
|
||||
auto error = control->error_ptr;
|
||||
auto *error = control->error_ptr;
|
||||
|
||||
/* assign default values */
|
||||
control->nthreads = 1;
|
||||
|
||||
@ -57,9 +57,9 @@ namespace ReaxFF {
|
||||
control_params *control, MPI_Comm world)
|
||||
{
|
||||
char ****tor_flag;
|
||||
auto error = control->error_ptr;
|
||||
auto lmp = control->lmp_ptr;
|
||||
auto memory = control->lmp_ptr->memory;
|
||||
auto *error = control->error_ptr;
|
||||
auto *lmp = control->lmp_ptr;
|
||||
auto *memory = control->lmp_ptr->memory;
|
||||
|
||||
// read and parse the force field only on rank 0
|
||||
|
||||
@ -84,7 +84,7 @@ namespace ReaxFF {
|
||||
|
||||
// check if header comment line is present
|
||||
|
||||
auto line = reader.next_line();
|
||||
auto *line = reader.next_line();
|
||||
if (strmatch(line, "^\\s*[0-9]+\\s+!.*general parameters.*"))
|
||||
THROW_ERROR("First line of ReaxFF potential file must be a comment or empty");
|
||||
++lineno;
|
||||
@ -556,7 +556,7 @@ namespace ReaxFF {
|
||||
for (k = 0; k < ntypes; ++k)
|
||||
hbp[i][j][k].r0_hb = -1.0;
|
||||
|
||||
auto thisline = reader.next_line();
|
||||
auto *thisline = reader.next_line();
|
||||
if (!thisline) throw EOFException("ReaxFF parameter file has no hydrogen bond parameters");
|
||||
|
||||
values = ValueTokenizer(thisline);
|
||||
|
||||
@ -98,7 +98,7 @@ void ComputePressureAlchemy::compute_vector()
|
||||
error->all(FLERR, Error::NOLASTLINE, "Virial was not tallied on needed timestep{}", utils::errorurl(22));
|
||||
|
||||
int dim = 0;
|
||||
double *pressure = (double *) fix->extract("pressure", dim);
|
||||
auto *pressure = (double *) fix->extract("pressure", dim);
|
||||
if (!pressure || (dim != 1))
|
||||
error->all(FLERR, Error::NOLASTLINE, "Could not extract pressure from fix alchemy");
|
||||
|
||||
|
||||
@ -133,7 +133,7 @@ void FixAlchemy::check_consistency_atoms()
|
||||
// check that owned atom ordering is same for each pair of replica procs
|
||||
// re-use communication buffer for positions and forces
|
||||
|
||||
tagint *tagbuf = (tagint *) commbuf;
|
||||
auto *tagbuf = (tagint *) commbuf;
|
||||
tagint *tag = atom->tag;
|
||||
if (universe->iworld == 0) {
|
||||
for (int i = 0; i < nlocal; ++i) tagbuf[i] = tag[i];
|
||||
|
||||
@ -79,7 +79,7 @@ void FixEventHyper::write_restart(FILE *fp)
|
||||
void FixEventHyper::restart(char *buf)
|
||||
{
|
||||
int n = 0;
|
||||
auto list = (double *) buf;
|
||||
auto *list = (double *) buf;
|
||||
|
||||
event_number = (int) ubuf(list[n++]).i;
|
||||
event_timestep = (bigint) ubuf(list[n++]).i;
|
||||
|
||||
@ -82,7 +82,7 @@ void FixEventPRD::write_restart(FILE *fp)
|
||||
void FixEventPRD::restart(char *buf)
|
||||
{
|
||||
int n = 0;
|
||||
auto list = (double *) buf;
|
||||
auto *list = (double *) buf;
|
||||
|
||||
event_number = static_cast<int> (list[n++]);
|
||||
event_timestep = static_cast<bigint> (list[n++]);
|
||||
|
||||
@ -78,7 +78,7 @@ void FixEventTAD::write_restart(FILE *fp)
|
||||
void FixEventTAD::restart(char *buf)
|
||||
{
|
||||
int n = 0;
|
||||
auto list = (double *) buf;
|
||||
auto *list = (double *) buf;
|
||||
|
||||
event_number = static_cast<int> (list[n++]);
|
||||
event_timestep = static_cast<int> (list[n++]);
|
||||
|
||||
@ -172,13 +172,13 @@ void FixGrem::init()
|
||||
if (!ifix) {
|
||||
error->all(FLERR,"Fix id for nvt or npt fix does not exist");
|
||||
} else { // check for correct fix style
|
||||
FixNH *nh = dynamic_cast<FixNH *>(ifix);
|
||||
auto *nh = dynamic_cast<FixNH *>(ifix);
|
||||
if (!nh) {
|
||||
error->all(FLERR, "Fix ID {} is not a compatible Nose-Hoover fix for fix {}", id_nh, style);
|
||||
} else {
|
||||
int dummy;
|
||||
auto t_start = (double *)nh->extract("t_start",dummy);
|
||||
auto t_stop = (double *)nh->extract("t_stop",dummy);
|
||||
auto *t_start = (double *)nh->extract("t_start",dummy);
|
||||
auto *t_stop = (double *)nh->extract("t_stop",dummy);
|
||||
if ((t_start != nullptr) && (t_stop != nullptr)) {
|
||||
tbath = *t_start;
|
||||
if (*t_start != *t_stop)
|
||||
@ -189,8 +189,8 @@ void FixGrem::init()
|
||||
pressref = 0.0;
|
||||
if (pressflag) {
|
||||
int *p_flag = (int *)nh->extract("p_flag",dummy);
|
||||
auto p_start = (double *) nh->extract("p_start",dummy);
|
||||
auto p_stop = (double *) nh->extract("p_stop",dummy);
|
||||
auto *p_start = (double *) nh->extract("p_start",dummy);
|
||||
auto *p_stop = (double *) nh->extract("p_stop",dummy);
|
||||
if ((p_flag != nullptr) && (p_start != nullptr) && (p_stop != nullptr)) {
|
||||
int ifix = 0;
|
||||
pressref = p_start[0];
|
||||
|
||||
@ -310,7 +310,7 @@ void FixHyperLocal::init()
|
||||
// NOTE: what if pair style list cutoff > Dcut
|
||||
// or what if neigh skin is huge?
|
||||
|
||||
auto req = neighbor->add_request(this, NeighConst::REQ_FULL | NeighConst::REQ_OCCASIONAL);
|
||||
auto *req = neighbor->add_request(this, NeighConst::REQ_FULL | NeighConst::REQ_OCCASIONAL);
|
||||
req->set_id(1);
|
||||
req->set_cutoff(dcut);
|
||||
|
||||
|
||||
@ -1699,7 +1699,7 @@ int FixPIMDLangevin::pack_restart_data(double *list)
|
||||
void FixPIMDLangevin::restart(char *buf)
|
||||
{
|
||||
int n = 0;
|
||||
auto list = (double *) buf;
|
||||
auto *list = (double *) buf;
|
||||
for (int i = 0; i < 6; i++) vw[i] = list[n++];
|
||||
}
|
||||
|
||||
|
||||
@ -59,8 +59,8 @@ void Hyper::command(int narg, char **arg)
|
||||
int nsteps = utils::inumeric(FLERR,arg[0],false,lmp);
|
||||
t_event = utils::inumeric(FLERR,arg[1],false,lmp);
|
||||
|
||||
auto id_fix = utils::strdup(arg[2]);
|
||||
auto id_compute = utils::strdup(arg[3]);
|
||||
auto *id_fix = utils::strdup(arg[2]);
|
||||
auto *id_compute = utils::strdup(arg[3]);
|
||||
|
||||
options(narg-4,&arg[4]);
|
||||
|
||||
@ -151,10 +151,10 @@ void Hyper::command(int narg, char **arg)
|
||||
|
||||
// cannot use hyper with time-dependent fixes or regions
|
||||
|
||||
for (auto &ifix : modify->get_fix_list())
|
||||
for (const auto &ifix : modify->get_fix_list())
|
||||
if (ifix->time_depend) error->all(FLERR,"Cannot use hyper with a time-dependent fix defined");
|
||||
|
||||
for (auto ® : domain->get_region_list())
|
||||
for (const auto ® : domain->get_region_list())
|
||||
if (reg->dynamic_check())
|
||||
error->all(FLERR,"Cannot use hyper with a time-dependent region defined");
|
||||
|
||||
@ -454,7 +454,7 @@ void Hyper::options(int narg, char **arg)
|
||||
} else if (strcmp(arg[iarg],"dump") == 0) {
|
||||
if (iarg+2 > narg) error->all(FLERR,"Illegal hyper command");
|
||||
dumpflag = 1;
|
||||
auto idump = output->get_dump_by_id(arg[iarg+1]);
|
||||
auto *idump = output->get_dump_by_id(arg[iarg+1]);
|
||||
if (!idump) error->all(FLERR,"Dump ID {} in hyper command does not exist", arg[iarg+1]);
|
||||
dumplist.emplace_back(idump);
|
||||
iarg += 2;
|
||||
|
||||
@ -473,7 +473,7 @@ void NEB::readfile(char *file, int flag)
|
||||
if (nlines < 0) error->universe_all(FLERR, "Incorrectly formatted NEB file");
|
||||
}
|
||||
|
||||
auto buffer = new char[CHUNK * MAXLINE];
|
||||
auto *buffer = new char[CHUNK * MAXLINE];
|
||||
double fraction = ireplica / (nreplica - 1.0);
|
||||
double **x = atom->x;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
@ -229,10 +229,10 @@ void PRD::command(int narg, char **arg)
|
||||
|
||||
// cannot use PRD with time-dependent fixes or regions
|
||||
|
||||
for (auto &ifix : modify->get_fix_list())
|
||||
for (const auto &ifix : modify->get_fix_list())
|
||||
if (ifix->time_depend) error->all(FLERR,"Cannot use PRD with a time-dependent fix defined");
|
||||
|
||||
for (auto ® : domain->get_region_list())
|
||||
for (const auto ® : domain->get_region_list())
|
||||
if (reg->dynamic_check())
|
||||
error->all(FLERR,"Cannot use PRD with a time-dependent region defined");
|
||||
|
||||
|
||||
@ -872,7 +872,7 @@ void TAD::compute_tlo(int ievent)
|
||||
|
||||
// update first event
|
||||
|
||||
auto statstr = (char *) "D ";
|
||||
auto * statstr = (char *) "D ";
|
||||
|
||||
if (ievent == 0) {
|
||||
deltfirst = deltlo;
|
||||
|
||||
@ -79,7 +79,7 @@ void TemperGrem::command(int narg, char **arg)
|
||||
|
||||
// Get and check if gREM fix exists and is correct style
|
||||
|
||||
auto ifix = modify->get_fix_by_id(arg[3]);
|
||||
auto *ifix = modify->get_fix_by_id(arg[3]);
|
||||
if (!ifix) error->universe_all(FLERR,fmt::format("Tempering fix ID {} is not defined", arg[3]));
|
||||
|
||||
fix_grem = dynamic_cast<FixGrem*>(ifix);
|
||||
@ -107,7 +107,7 @@ void TemperGrem::command(int narg, char **arg)
|
||||
|
||||
if (pressflag) {
|
||||
int dummy;
|
||||
auto p_start = (double *) nh->extract("p_start",dummy);
|
||||
auto *p_start = (double *) nh->extract("p_start",dummy);
|
||||
pressref = p_start[0];
|
||||
}
|
||||
|
||||
|
||||
@ -358,7 +358,7 @@ void BondRHEOShell::init_style()
|
||||
auto fixes = modify->get_fix_by_style("^rheo$");
|
||||
if (fixes.size() == 0)
|
||||
error->all(FLERR, Error::NOLASTLINE, "Need to define fix rheo to use bond rheo/shell");
|
||||
class FixRHEO *fix_rheo = dynamic_cast<FixRHEO *>(fixes[0]);
|
||||
auto *fix_rheo = dynamic_cast<FixRHEO *>(fixes[0]);
|
||||
|
||||
if (!fix_rheo->surface_flag)
|
||||
error->all(FLERR, Error::NOLASTLINE, "Bond rheo/shell requires surface calculation in fix rheo");
|
||||
@ -367,7 +367,7 @@ void BondRHEOShell::init_style()
|
||||
fixes = modify->get_fix_by_style("^rheo/oxidation$");
|
||||
if (fixes.size() == 0)
|
||||
error->all(FLERR, Error::NOLASTLINE, "Need to define fix rheo/oxidation to use bond rheo/shell");
|
||||
class FixRHEOOxidation *fix_rheo_oxidation = dynamic_cast<FixRHEOOxidation *>(fixes[0]);
|
||||
auto *fix_rheo_oxidation = dynamic_cast<FixRHEOOxidation *>(fixes[0]);
|
||||
|
||||
rsurf = fix_rheo_oxidation->rsurf;
|
||||
rmax = fix_rheo_oxidation->cut;
|
||||
@ -554,7 +554,7 @@ void BondRHEOShell::process_ineligibility(int i, int j)
|
||||
bond_type[i][m] = bond_type[i][n - 1];
|
||||
bond_atom[i][m] = bond_atom[i][n - 1];
|
||||
for (auto &ihistory : histories) {
|
||||
auto fix_bond_history2 = dynamic_cast<FixBondHistory *>(ihistory);
|
||||
auto *fix_bond_history2 = dynamic_cast<FixBondHistory *>(ihistory);
|
||||
fix_bond_history2->shift_history(i, m, n - 1);
|
||||
fix_bond_history2->delete_history(i, n - 1);
|
||||
}
|
||||
@ -572,7 +572,7 @@ void BondRHEOShell::process_ineligibility(int i, int j)
|
||||
bond_type[j][m] = bond_type[j][n - 1];
|
||||
bond_atom[j][m] = bond_atom[j][n - 1];
|
||||
for (auto &ihistory : histories) {
|
||||
auto fix_bond_history2 = dynamic_cast<FixBondHistory *>(ihistory);
|
||||
auto *fix_bond_history2 = dynamic_cast<FixBondHistory *>(ihistory);
|
||||
fix_bond_history2->shift_history(j, m, n - 1);
|
||||
fix_bond_history2->delete_history(j, n - 1);
|
||||
}
|
||||
|
||||
@ -293,7 +293,7 @@ void FixRHEOThermal::init()
|
||||
if (force->newton_pair) error->all(FLERR, "Need Newton off for reactive bond generation");
|
||||
|
||||
// need a half neighbor list, built only when particles freeze
|
||||
auto req = neighbor->add_request(this, NeighConst::REQ_OCCASIONAL);
|
||||
auto *req = neighbor->add_request(this, NeighConst::REQ_OCCASIONAL);
|
||||
req->set_cutoff(cut_kernel);
|
||||
|
||||
// find instances of bond history to delete/shift data
|
||||
@ -547,7 +547,7 @@ void FixRHEOThermal::break_bonds()
|
||||
bond_atom[i][m] = bond_atom[i][nmax];
|
||||
if (n_histories > 0) {
|
||||
for (auto &ihistory : histories) {
|
||||
auto fix_bond_history = dynamic_cast<FixBondHistory *>(ihistory);
|
||||
auto *fix_bond_history = dynamic_cast<FixBondHistory *>(ihistory);
|
||||
fix_bond_history->shift_history(i, m, nmax);
|
||||
fix_bond_history->delete_history(i, nmax);
|
||||
}
|
||||
@ -592,7 +592,7 @@ void FixRHEOThermal::break_bonds()
|
||||
bond_atom[i][m] = bond_atom[i][nmax];
|
||||
if (n_histories > 0)
|
||||
for (auto &ihistory : histories) {
|
||||
auto fix_bond_history = dynamic_cast<FixBondHistory *>(ihistory);
|
||||
auto *fix_bond_history = dynamic_cast<FixBondHistory *>(ihistory);
|
||||
fix_bond_history->shift_history(i, m, nmax);
|
||||
fix_bond_history->delete_history(i, nmax);
|
||||
}
|
||||
@ -611,7 +611,7 @@ void FixRHEOThermal::break_bonds()
|
||||
bond_atom[j][m] = bond_atom[j][nmax];
|
||||
if (n_histories > 0)
|
||||
for (auto &ihistory : histories) {
|
||||
auto fix_bond_history = dynamic_cast<FixBondHistory *>(ihistory);
|
||||
auto *fix_bond_history = dynamic_cast<FixBondHistory *>(ihistory);
|
||||
fix_bond_history->shift_history(j, m, nmax);
|
||||
fix_bond_history->delete_history(j, nmax);
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ void ComputeRigidLocal::init()
|
||||
{
|
||||
// set fixrigid
|
||||
|
||||
auto ifix = modify->get_fix_by_id(idrigid);
|
||||
auto *ifix = modify->get_fix_by_id(idrigid);
|
||||
if (!ifix) error->all(FLERR,"FixRigidSmall ID {} for compute rigid/local does not exist", idrigid);
|
||||
fixrigid = dynamic_cast<FixRigidSmall *>(ifix);
|
||||
if (!fixrigid)
|
||||
|
||||
@ -151,7 +151,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
|
||||
if (input->variable->atomstyle(ivariable) == 0)
|
||||
error->all(FLERR, "Fix {} custom variable {} is not atom-style variable", style,
|
||||
arg[4] + 2);
|
||||
auto value = new double[nlocal];
|
||||
auto *value = new double[nlocal];
|
||||
input->variable->compute_atom(ivariable, 0, value, 1, 0);
|
||||
int minval = INT_MAX;
|
||||
for (i = 0; i < nlocal; i++)
|
||||
@ -705,14 +705,14 @@ void FixRigid::init()
|
||||
// if earlyflag, warn if any post-force fixes come after a rigid fix
|
||||
|
||||
int count = 0;
|
||||
for (auto &ifix : modify->get_fix_list())
|
||||
for (const auto &ifix : modify->get_fix_list())
|
||||
if (ifix->rigid_flag) count++;
|
||||
if (count > 1 && comm->me == 0)
|
||||
error->warning(FLERR,"More than one fix rigid");
|
||||
|
||||
if (earlyflag) {
|
||||
bool rflag = false;
|
||||
for (auto &ifix : modify->get_fix_list()) {
|
||||
for (const auto &ifix : modify->get_fix_list()) {
|
||||
if (ifix->rigid_flag) rflag = true;
|
||||
if ((comm->me == 0) && rflag && (ifix->setmask() & POST_FORCE) && !ifix->rigid_flag)
|
||||
error->warning(FLERR, "Fix {} with ID {} alters forces after fix rigid",
|
||||
@ -735,7 +735,7 @@ void FixRigid::init()
|
||||
// error if a fix changing the box comes before rigid fix
|
||||
|
||||
bool boxflag = false;
|
||||
for (auto &ifix : modify->get_fix_list()) {
|
||||
for (const auto &ifix : modify->get_fix_list()) {
|
||||
if (boxflag && utils::strmatch(ifix->style,"^rigid"))
|
||||
error->all(FLERR,"Rigid fixes must come before any box changing fix");
|
||||
if (ifix->box_change) boxflag = true;
|
||||
@ -744,7 +744,7 @@ void FixRigid::init()
|
||||
// add gravity forces based on gravity vector from fix
|
||||
|
||||
if (id_gravity) {
|
||||
auto ifix = modify->get_fix_by_id(id_gravity);
|
||||
auto *ifix = modify->get_fix_by_id(id_gravity);
|
||||
if (!ifix) error->all(FLERR,"Fix rigid cannot find fix gravity ID {}", id_gravity);
|
||||
if (!utils::strmatch(ifix->style,"^gravity"))
|
||||
error->all(FLERR,"Fix rigid gravity fix ID {} is not a gravity fix style", id_gravity);
|
||||
@ -2352,7 +2352,7 @@ void FixRigid::readfile(int which, double *vec, double **array1, double **array2
|
||||
if (nlines == 0) return;
|
||||
else if (nlines < 0) error->all(FLERR,"Fix rigid infile has incorrect format");
|
||||
|
||||
auto buffer = new char[CHUNK*MAXLINE];
|
||||
auto *buffer = new char[CHUNK*MAXLINE];
|
||||
int nread = 0;
|
||||
int me = comm->me;
|
||||
while (nread < nlines) {
|
||||
|
||||
@ -260,8 +260,8 @@ void FixRigidNH::init()
|
||||
|
||||
// ensure no conflict with fix deform
|
||||
|
||||
for (auto &ifix : modify->get_fix_by_style("^deform")) {
|
||||
auto deform = dynamic_cast<FixDeform *>(ifix);
|
||||
for (const auto &ifix : modify->get_fix_by_style("^deform")) {
|
||||
auto *deform = dynamic_cast<FixDeform *>(ifix);
|
||||
if (deform) {
|
||||
int *dimflag = deform->dimflag;
|
||||
if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || (p_flag[2] && dimflag[2]))
|
||||
@ -299,7 +299,7 @@ void FixRigidNH::init()
|
||||
// this will include self
|
||||
|
||||
rfix.clear();
|
||||
for (auto &ifix : modify->get_fix_list())
|
||||
for (const auto &ifix : modify->get_fix_list())
|
||||
if (ifix->rigid_flag) rfix.push_back(ifix);
|
||||
}
|
||||
}
|
||||
@ -1146,7 +1146,7 @@ void FixRigidNH::write_restart(FILE *fp)
|
||||
void FixRigidNH::restart(char *buf)
|
||||
{
|
||||
int n = 0;
|
||||
auto list = (double *) buf;
|
||||
auto *list = (double *) buf;
|
||||
int flag = static_cast<int> (list[n++]);
|
||||
|
||||
if (flag) {
|
||||
|
||||
@ -235,8 +235,8 @@ void FixRigidNHSmall::init()
|
||||
|
||||
// ensure no conflict with fix deform
|
||||
|
||||
for (auto &ifix : modify->get_fix_by_style("^deform")) {
|
||||
auto deform = dynamic_cast<FixDeform *>(ifix);
|
||||
for (const auto &ifix : modify->get_fix_by_style("^deform")) {
|
||||
auto *deform = dynamic_cast<FixDeform *>(ifix);
|
||||
if (deform) {
|
||||
int *dimflag = deform->dimflag;
|
||||
if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) ||
|
||||
@ -275,7 +275,7 @@ void FixRigidNHSmall::init()
|
||||
// this will include self
|
||||
|
||||
rfix.clear();
|
||||
for (auto &ifix : modify->get_fix_list())
|
||||
for (const auto &ifix : modify->get_fix_list())
|
||||
if (ifix->rigid_flag) rfix.push_back(ifix);
|
||||
}
|
||||
}
|
||||
@ -1235,7 +1235,7 @@ void FixRigidNHSmall::write_restart(FILE *fp)
|
||||
void FixRigidNHSmall::restart(char *buf)
|
||||
{
|
||||
int n = 0;
|
||||
auto list = (double *) buf;
|
||||
auto *list = (double *) buf;
|
||||
int flag = static_cast<int> (list[n++]);
|
||||
|
||||
if (flag) {
|
||||
|
||||
@ -134,7 +134,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) :
|
||||
error->all(FLERR,"Variable {} for fix {} custom does not exist", arg[4]+2, style);
|
||||
if (input->variable->atomstyle(ivariable) == 0)
|
||||
error->all(FLERR,"Fix {} custom variable {} is not atom-style variable", style, arg[4]+2);
|
||||
auto value = new double[nlocal];
|
||||
auto *value = new double[nlocal];
|
||||
input->variable->compute_atom(ivariable,0,value,1,0);
|
||||
int minval = INT_MAX;
|
||||
for (i = 0; i < nlocal; i++)
|
||||
@ -523,14 +523,14 @@ void FixRigidSmall::init()
|
||||
// if earlyflag, warn if any post-force fixes come after a rigid fix
|
||||
|
||||
int count = 0;
|
||||
for (auto &ifix : modify->get_fix_list())
|
||||
for (const auto &ifix : modify->get_fix_list())
|
||||
if (ifix->rigid_flag) count++;
|
||||
if (count > 1 && comm->me == 0)
|
||||
error->warning(FLERR, "More than one fix rigid command");
|
||||
|
||||
if (earlyflag) {
|
||||
bool rflag = false;
|
||||
for (auto &ifix : modify->get_fix_list()) {
|
||||
for (const auto &ifix : modify->get_fix_list()) {
|
||||
if (ifix->rigid_flag) rflag = true;
|
||||
if ((comm->me == 0) && rflag && (ifix->setmask() & POST_FORCE) && !ifix->rigid_flag)
|
||||
error->warning(FLERR,"Fix {} with ID {} alters forces after fix {}",
|
||||
@ -553,7 +553,7 @@ void FixRigidSmall::init()
|
||||
// error if a fix changing the box comes before rigid fix
|
||||
|
||||
bool boxflag = false;
|
||||
for (auto &ifix : modify->get_fix_list()) {
|
||||
for (const auto &ifix : modify->get_fix_list()) {
|
||||
if (boxflag && utils::strmatch(ifix->style,"^rigid"))
|
||||
error->all(FLERR,"Rigid fixes must come before any box changing fix");
|
||||
if (ifix->box_change) boxflag = true;
|
||||
@ -562,7 +562,7 @@ void FixRigidSmall::init()
|
||||
// add gravity forces based on gravity vector from fix
|
||||
|
||||
if (id_gravity) {
|
||||
auto ifix = modify->get_fix_by_id(id_gravity);
|
||||
auto *ifix = modify->get_fix_by_id(id_gravity);
|
||||
if (!ifix) error->all(FLERR,"Fix {} cannot find fix gravity ID {}", style, id_gravity);
|
||||
if (!utils::strmatch(ifix->style,"^gravity"))
|
||||
error->all(FLERR,"Fix {} gravity fix ID {} is not a gravity fix style", style, id_gravity);
|
||||
@ -1582,7 +1582,7 @@ void FixRigidSmall::create_bodies(tagint *bodyID)
|
||||
|
||||
int *proclist;
|
||||
memory->create(proclist,ncount,"rigid/small:proclist");
|
||||
auto inbuf = (InRvous *) memory->smalloc(ncount*sizeof(InRvous),"rigid/small:inbuf");
|
||||
auto *inbuf = (InRvous *) memory->smalloc(ncount*sizeof(InRvous),"rigid/small:inbuf");
|
||||
|
||||
// setup buf to pass to rendezvous comm
|
||||
// one BodyMsg datum for each constituent atom
|
||||
@ -1617,7 +1617,7 @@ void FixRigidSmall::create_bodies(tagint *bodyID)
|
||||
0,proclist,
|
||||
rendezvous_body,0,buf,sizeof(OutRvous),
|
||||
(void *) this);
|
||||
auto outbuf = (OutRvous *) buf;
|
||||
auto *outbuf = (OutRvous *) buf;
|
||||
|
||||
memory->destroy(proclist);
|
||||
memory->sfree(inbuf);
|
||||
@ -1659,7 +1659,7 @@ int FixRigidSmall::rendezvous_body(int n, char *inbuf,
|
||||
double *x,*xown,*rsqclose;
|
||||
double **bbox,**ctr;
|
||||
|
||||
auto frsptr = (FixRigidSmall *) ptr;
|
||||
auto *frsptr = (FixRigidSmall *) ptr;
|
||||
Memory *memory = frsptr->memory;
|
||||
Error *error = frsptr->error;
|
||||
MPI_Comm world = frsptr->world;
|
||||
@ -1671,7 +1671,7 @@ int FixRigidSmall::rendezvous_body(int n, char *inbuf,
|
||||
// key = body ID
|
||||
// value = index into Ncount-length data structure
|
||||
|
||||
auto in = (InRvous *) inbuf;
|
||||
auto *in = (InRvous *) inbuf;
|
||||
std::map<tagint,int> hash;
|
||||
tagint id;
|
||||
|
||||
@ -1766,7 +1766,7 @@ int FixRigidSmall::rendezvous_body(int n, char *inbuf,
|
||||
|
||||
int nout = n;
|
||||
memory->create(proclist,nout,"rigid/small:proclist");
|
||||
auto out = (OutRvous *) memory->smalloc(nout*sizeof(OutRvous),"rigid/small:out");
|
||||
auto *out = (OutRvous *) memory->smalloc(nout*sizeof(OutRvous),"rigid/small:out");
|
||||
|
||||
for (i = 0; i < nout; i++) {
|
||||
proclist[i] = in[i].me;
|
||||
@ -2532,7 +2532,7 @@ void FixRigidSmall::readfile(int which, double **array, int *inbody)
|
||||
if (nlines == 0) return;
|
||||
else if (nlines < 0) error->all(FLERR,"Fix {} infile has incorrect format", style);
|
||||
|
||||
auto buffer = new char[CHUNK*MAXLINE];
|
||||
auto *buffer = new char[CHUNK*MAXLINE];
|
||||
int nread = 0;
|
||||
int me = comm->me;
|
||||
|
||||
|
||||
@ -388,7 +388,7 @@ void FixShake::init()
|
||||
|
||||
// error if a fix changing the box comes before shake fix
|
||||
bool boxflag = false;
|
||||
for (auto &ifix : modify->get_fix_list()) {
|
||||
for (const auto &ifix : modify->get_fix_list()) {
|
||||
if (boxflag && utils::strmatch(ifix->style,pattern))
|
||||
error->all(FLERR,"Fix {} must come before any box changing fix", style);
|
||||
if (ifix->box_change) boxflag = true;
|
||||
@ -407,7 +407,7 @@ void FixShake::init()
|
||||
if (fixes.size() > 0) fix_respa = dynamic_cast<FixRespa *>(fixes.front());
|
||||
else error->all(FLERR,"Run style respa did not create fix RESPA");
|
||||
}
|
||||
auto respa_ptr = dynamic_cast<Respa *>(update->integrate);
|
||||
auto *respa_ptr = dynamic_cast<Respa *>(update->integrate);
|
||||
if (!respa_ptr) error->all(FLERR, "Failure to access Respa style {}", update->integrate_style);
|
||||
respa = 1;
|
||||
nlevels_respa = respa_ptr->nlevels;
|
||||
@ -508,7 +508,7 @@ void FixShake::setup(int vflag)
|
||||
dtfsq = 0.5 * update->dt * update->dt * force->ftm2v;
|
||||
if (!rattle) dtfsq = update->dt * update->dt * force->ftm2v;
|
||||
} else {
|
||||
auto respa_ptr = dynamic_cast<Respa *>(update->integrate);
|
||||
auto *respa_ptr = dynamic_cast<Respa *>(update->integrate);
|
||||
if (!respa_ptr) error->all(FLERR, "Failure to access Respa style {}", update->integrate_style);
|
||||
if (update->whichflag > 0) {
|
||||
auto fixes = modify->get_fix_by_style("^RESPA");
|
||||
@ -1171,7 +1171,7 @@ void FixShake::atom_owners()
|
||||
|
||||
int *proclist;
|
||||
memory->create(proclist,nlocal,"shake:proclist");
|
||||
auto idbuf = (IDRvous *) memory->smalloc((bigint) nlocal*sizeof(IDRvous),"shake:idbuf");
|
||||
auto *idbuf = (IDRvous *) memory->smalloc((bigint) nlocal*sizeof(IDRvous),"shake:idbuf");
|
||||
|
||||
// setup input buf to rendezvous comm
|
||||
// input datums = pairs of bonded atoms
|
||||
@ -1220,7 +1220,7 @@ void FixShake::partner_info(int *npartner, tagint **partner_tag,
|
||||
|
||||
int *proclist;
|
||||
memory->create(proclist,nsend,"special:proclist");
|
||||
auto inbuf = (PartnerInfo *) memory->smalloc((bigint) nsend*sizeof(PartnerInfo),"special:inbuf");
|
||||
auto *inbuf = (PartnerInfo *) memory->smalloc((bigint) nsend*sizeof(PartnerInfo),"special:inbuf");
|
||||
|
||||
// set values in 4 partner arrays for all partner atoms I own
|
||||
// also setup input buf to rendezvous comm
|
||||
@ -1298,7 +1298,7 @@ void FixShake::partner_info(int *npartner, tagint **partner_tag,
|
||||
rendezvous_partners_info,
|
||||
0,buf,sizeof(PartnerInfo),
|
||||
(void *) this);
|
||||
auto outbuf = (PartnerInfo *) buf;
|
||||
auto *outbuf = (PartnerInfo *) buf;
|
||||
|
||||
memory->destroy(proclist);
|
||||
memory->sfree(inbuf);
|
||||
@ -1348,7 +1348,7 @@ void FixShake::nshake_info(int *npartner, tagint **partner_tag,
|
||||
|
||||
int *proclist;
|
||||
memory->create(proclist,nsend,"special:proclist");
|
||||
auto inbuf = (NShakeInfo *) memory->smalloc((bigint) nsend*sizeof(NShakeInfo),"special:inbuf");
|
||||
auto *inbuf = (NShakeInfo *) memory->smalloc((bigint) nsend*sizeof(NShakeInfo),"special:inbuf");
|
||||
|
||||
// set partner_nshake for all partner atoms I own
|
||||
// also setup input buf to rendezvous comm
|
||||
@ -1385,7 +1385,7 @@ void FixShake::nshake_info(int *npartner, tagint **partner_tag,
|
||||
0,proclist,
|
||||
rendezvous_nshake,0,buf,sizeof(NShakeInfo),
|
||||
(void *) this);
|
||||
auto outbuf = (NShakeInfo *) buf;
|
||||
auto *outbuf = (NShakeInfo *) buf;
|
||||
|
||||
memory->destroy(proclist);
|
||||
memory->sfree(inbuf);
|
||||
@ -1426,7 +1426,7 @@ void FixShake::shake_info(int *npartner, tagint **partner_tag,
|
||||
|
||||
int *proclist;
|
||||
memory->create(proclist,nsend,"special:proclist");
|
||||
auto inbuf = (ShakeInfo *) memory->smalloc((bigint) nsend*sizeof(ShakeInfo),"special:inbuf");
|
||||
auto *inbuf = (ShakeInfo *) memory->smalloc((bigint) nsend*sizeof(ShakeInfo),"special:inbuf");
|
||||
|
||||
// set 3 shake arrays for all partner atoms I own
|
||||
// also setup input buf to rendezvous comm
|
||||
@ -1477,7 +1477,7 @@ void FixShake::shake_info(int *npartner, tagint **partner_tag,
|
||||
0,proclist,
|
||||
rendezvous_shake,0,buf,sizeof(ShakeInfo),
|
||||
(void *) this);
|
||||
auto outbuf = (ShakeInfo *) buf;
|
||||
auto *outbuf = (ShakeInfo *) buf;
|
||||
|
||||
memory->destroy(proclist);
|
||||
memory->sfree(inbuf);
|
||||
@ -1509,7 +1509,7 @@ int FixShake::rendezvous_ids(int n, char *inbuf,
|
||||
int &flag, int *& /*proclist*/, char *& /*outbuf*/,
|
||||
void *ptr)
|
||||
{
|
||||
auto fsptr = (FixShake *) ptr;
|
||||
auto *fsptr = (FixShake *) ptr;
|
||||
Memory *memory = fsptr->memory;
|
||||
|
||||
tagint *atomIDs;
|
||||
@ -1518,7 +1518,7 @@ int FixShake::rendezvous_ids(int n, char *inbuf,
|
||||
memory->create(atomIDs,n,"special:atomIDs");
|
||||
memory->create(procowner,n,"special:procowner");
|
||||
|
||||
auto in = (IDRvous *) inbuf;
|
||||
auto *in = (IDRvous *) inbuf;
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
atomIDs[i] = in[i].atomID;
|
||||
@ -1549,7 +1549,7 @@ int FixShake::rendezvous_partners_info(int n, char *inbuf,
|
||||
{
|
||||
int i,m;
|
||||
|
||||
auto fsptr = (FixShake *) ptr;
|
||||
auto *fsptr = (FixShake *) ptr;
|
||||
Atom *atom = fsptr->atom;
|
||||
Memory *memory = fsptr->memory;
|
||||
|
||||
@ -1569,7 +1569,7 @@ int FixShake::rendezvous_partners_info(int n, char *inbuf,
|
||||
// proclist = owner of atomID in caller decomposition
|
||||
// outbuf = info about owned atomID = 4 values
|
||||
|
||||
auto in = (PartnerInfo *) inbuf;
|
||||
auto *in = (PartnerInfo *) inbuf;
|
||||
int *procowner = fsptr->procowner;
|
||||
memory->create(proclist,n,"shake:proclist");
|
||||
|
||||
@ -1604,7 +1604,7 @@ int FixShake::rendezvous_nshake(int n, char *inbuf,
|
||||
{
|
||||
int i,m;
|
||||
|
||||
auto fsptr = (FixShake *) ptr;
|
||||
auto *fsptr = (FixShake *) ptr;
|
||||
Atom *atom = fsptr->atom;
|
||||
Memory *memory = fsptr->memory;
|
||||
|
||||
@ -1624,7 +1624,7 @@ int FixShake::rendezvous_nshake(int n, char *inbuf,
|
||||
// proclist = owner of atomID in caller decomposition
|
||||
// outbuf = info about owned atomID
|
||||
|
||||
auto in = (NShakeInfo *) inbuf;
|
||||
auto *in = (NShakeInfo *) inbuf;
|
||||
int *procowner = fsptr->procowner;
|
||||
memory->create(proclist,n,"shake:proclist");
|
||||
|
||||
@ -1658,7 +1658,7 @@ int FixShake::rendezvous_shake(int n, char *inbuf,
|
||||
{
|
||||
int i,m;
|
||||
|
||||
auto fsptr = (FixShake *) ptr;
|
||||
auto *fsptr = (FixShake *) ptr;
|
||||
Atom *atom = fsptr->atom;
|
||||
Memory *memory = fsptr->memory;
|
||||
|
||||
@ -1678,7 +1678,7 @@ int FixShake::rendezvous_shake(int n, char *inbuf,
|
||||
// proclist = owner of atomID in caller decomposition
|
||||
// outbuf = info about owned atomID
|
||||
|
||||
auto in = (ShakeInfo *) inbuf;
|
||||
auto *in = (ShakeInfo *) inbuf;
|
||||
int *procowner = fsptr->procowner;
|
||||
memory->create(proclist,n,"shake:proclist");
|
||||
|
||||
@ -3159,7 +3159,7 @@ void FixShake::reset_dt()
|
||||
else dtfsq = update->dt * update->dt * force->ftm2v;
|
||||
respa = 0;
|
||||
} else {
|
||||
auto respa_ptr = dynamic_cast<Respa *>(update->integrate);
|
||||
auto *respa_ptr = dynamic_cast<Respa *>(update->integrate);
|
||||
if (!respa_ptr) error->all(FLERR, "Failure to access Respa style {}", update->integrate_style);
|
||||
respa = 1;
|
||||
nlevels_respa = respa_ptr->nlevels;
|
||||
|
||||
@ -272,8 +272,8 @@ int FixAppendAtoms::get_spatial()
|
||||
else failed = 0;
|
||||
count++;
|
||||
}
|
||||
auto pos = new double[count-2];
|
||||
auto val = new double[count-2];
|
||||
auto *pos = new double[count-2];
|
||||
auto *val = new double[count-2];
|
||||
for (int loop=0; loop < count-2; loop++) {
|
||||
pos[loop] = fix->compute_vector(2*loop);
|
||||
val[loop] = fix->compute_vector(2*loop+1);
|
||||
|
||||
@ -291,7 +291,7 @@ void FixMSST::init()
|
||||
// detect if any fix rigid exist so rigid bodies move when box is dilated
|
||||
|
||||
rfix.clear();
|
||||
for (auto &ifix : modify->get_fix_list())
|
||||
for (const auto &ifix : modify->get_fix_list())
|
||||
if (ifix->rigid_flag) rfix.push_back(ifix);
|
||||
|
||||
// find fix external being used to drive LAMMPS from DFTB+
|
||||
@ -786,7 +786,7 @@ void FixMSST::write_restart(FILE *fp)
|
||||
void FixMSST::restart(char *buf)
|
||||
{
|
||||
int n = 0;
|
||||
auto list = (double *) buf;
|
||||
auto *list = (double *) buf;
|
||||
omega[direction] = list[n++];
|
||||
e0 = list[n++];
|
||||
v0 = list[n++];
|
||||
|
||||
@ -398,7 +398,7 @@ int FixNPHug::size_restart_global()
|
||||
void FixNPHug::restart(char *buf)
|
||||
{
|
||||
int n = 0;
|
||||
auto list = (double *) buf;
|
||||
auto *list = (double *) buf;
|
||||
e0 = list[n++];
|
||||
v0 = list[n++];
|
||||
p0 = list[n++];
|
||||
|
||||
@ -422,7 +422,7 @@ void NEBSpin::readfile(char *file, int flag)
|
||||
error->all(FLERR,"Incorrectly formatted NEB file");
|
||||
}
|
||||
|
||||
auto buffer = new char[CHUNK*MAXLINE];
|
||||
auto *buffer = new char[CHUNK*MAXLINE];
|
||||
double fraction = ireplica/(nreplica-1.0);
|
||||
double **x = atom->x;
|
||||
double **sp = atom->sp;
|
||||
|
||||
@ -395,7 +395,7 @@ void FixSRD::init()
|
||||
if (fixes[i]->box_change & BOX_CHANGE_SHAPE) change_shape = 1;
|
||||
if (strcmp(fixes[i]->style, "deform") == 0) {
|
||||
deformflag = 1;
|
||||
auto deform = dynamic_cast<FixDeform *>(modify->fix[i]);
|
||||
auto *deform = dynamic_cast<FixDeform *>(modify->fix[i]);
|
||||
if ((deform->box_change & BOX_CHANGE_SHAPE) && deform->remapflag != Domain::V_REMAP)
|
||||
error->all(FLERR, "Using fix srd with inconsistent fix deform remap option");
|
||||
}
|
||||
|
||||
@ -228,7 +228,7 @@ void FixNHUef::init()
|
||||
|
||||
|
||||
// find conflict with fix/deform or other box chaging fixes
|
||||
for (auto &ifix : modify->get_fix_list()) {
|
||||
for (const auto &ifix : modify->get_fix_list()) {
|
||||
if (strcmp(ifix->id, id) != 0)
|
||||
if ((ifix->box_change & BOX_CHANGE_SHAPE) != 0)
|
||||
error->all(FLERR,"Can't use another fix which changes box shape with fix {}", style);
|
||||
@ -710,7 +710,7 @@ void FixNHUef::restart(char *buf)
|
||||
{
|
||||
int n = size_restart_global();
|
||||
FixNH::restart(buf);
|
||||
auto list = (double *) buf;
|
||||
auto *list = (double *) buf;
|
||||
strain[0] = list[n-2];
|
||||
strain[1] = list[n-1];
|
||||
uefbox->set_strain(strain[0],strain[1]);
|
||||
|
||||
Reference in New Issue
Block a user