diff --git a/src/ELECTRODE/boundary_correction.cpp b/src/ELECTRODE/boundary_correction.cpp index d139307829..cfd9341777 100644 --- a/src/ELECTRODE/boundary_correction.cpp +++ b/src/ELECTRODE/boundary_correction.cpp @@ -35,7 +35,7 @@ double BoundaryCorrection::get_volume() std::vector BoundaryCorrection::gather_recvcounts(int n) { - int const nprocs = comm->nprocs; + const int nprocs = comm->nprocs; std::vector recvcounts = std::vector(nprocs); MPI_Allgather(&n, 1, MPI_INT, recvcounts.data(), 1, MPI_INT, world); return recvcounts; @@ -43,7 +43,7 @@ std::vector BoundaryCorrection::gather_recvcounts(int n) std::vector BoundaryCorrection::gather_displs(const std::vector &recvcounts) { - int const nprocs = comm->nprocs; + const int nprocs = comm->nprocs; std::vector displs = std::vector(nprocs); displs[0] = 0; for (int i = 1; i < nprocs; i++) displs[i] = displs[i - 1] + recvcounts[i - 1]; diff --git a/src/ELECTRODE/electrode_matrix.cpp b/src/ELECTRODE/electrode_matrix.cpp index 234da1be6b..efb92d7ef4 100644 --- a/src/ELECTRODE/electrode_matrix.cpp +++ b/src/ELECTRODE/electrode_matrix.cpp @@ -138,7 +138,7 @@ void ElectrodeMatrix::pair_contribution(double **array) // skip if atom I is not in either group if (!(mask[i] & groupbit)) continue; - bigint const ipos = mpos[i]; + const bigint ipos = mpos[i]; xtmp = x[i][0]; ytmp = x[i][1]; ztmp = x[i][2]; @@ -210,7 +210,7 @@ void ElectrodeMatrix::tf_contribution(double **array) void ElectrodeMatrix::update_mpos() { - int const nall = atom->nlocal + atom->nghost; + const int nall = atom->nlocal + atom->nghost; tagint *tag = atom->tag; int *mask = atom->mask; mpos = std::vector(nall, -1); diff --git a/src/ELECTRODE/electrode_vector.cpp b/src/ELECTRODE/electrode_vector.cpp index 582aad7b3c..362de2b79f 100644 --- a/src/ELECTRODE/electrode_vector.cpp +++ b/src/ELECTRODE/electrode_vector.cpp @@ -135,15 +135,15 @@ void ElectrodeVector::pair_contribution(double *vector) int *type = atom->type; int *mask = atom->mask; // neighbor list will be ready because called from post_neighbor - int const nlocal = atom->nlocal; - int const inum = list->inum; + const int nlocal = atom->nlocal; + const int inum = list->inum; int *ilist = list->ilist; int *numneigh = list->numneigh; int **firstneigh = list->firstneigh; int newton_pair = force->newton_pair; for (int ii = 0; ii < inum; ii++) { - int const i = ilist[ii]; + const int i = ilist[ii]; bool const i_in_sensor = (mask[i] & groupbit); bool const i_in_source = !!(mask[i] & source_grpbit) != invert_source; if (!(i_in_sensor || i_in_source)) continue; @@ -155,7 +155,7 @@ void ElectrodeVector::pair_contribution(double *vector) int *jlist = firstneigh[i]; int jnum = numneigh[i]; for (int jj = 0; jj < jnum; jj++) { - int const j = jlist[jj] & NEIGHMASK; + const int j = jlist[jj] & NEIGHMASK; bool const j_in_sensor = (mask[j] & groupbit); bool const j_in_source = !!(mask[j] & source_grpbit) != invert_source; bool const compute_ij = i_in_sensor && j_in_source; @@ -192,7 +192,7 @@ void ElectrodeVector::pair_contribution(double *vector) void ElectrodeVector::self_contribution(double *vector) { - int const inum = list->inum; + const int inum = list->inum; int *mask = atom->mask; int *ilist = list->ilist; double *q = atom->q; @@ -201,7 +201,7 @@ void ElectrodeVector::self_contribution(double *vector) const double preta = MY_SQRT2 / MY_PIS; for (int ii = 0; ii < inum; ii++) { - int const i = ilist[ii]; + const int i = ilist[ii]; double const eta_i = etaflag ? atom->dvector[eta_index][i] : eta; bool const i_in_sensor = (mask[i] & groupbit); bool const i_in_source = !!(mask[i] & source_grpbit) != invert_source; @@ -213,14 +213,14 @@ void ElectrodeVector::self_contribution(double *vector) void ElectrodeVector::tf_contribution(double *vector) { - int const inum = list->inum; + const int inum = list->inum; int *mask = atom->mask; int *type = atom->type; int *ilist = list->ilist; double *q = atom->q; for (int ii = 0; ii < inum; ii++) { - int const i = ilist[ii]; + const int i = ilist[ii]; bool const i_in_sensor = (mask[i] & groupbit); bool const i_in_source = !!(mask[i] & source_grpbit) != invert_source; if (i_in_sensor && i_in_source) vector[i] += tf_types[type[i]] * q[i]; diff --git a/src/ELECTRODE/ewald_electrode.cpp b/src/ELECTRODE/ewald_electrode.cpp index 78b5309815..de22290867 100644 --- a/src/ELECTRODE/ewald_electrode.cpp +++ b/src/ELECTRODE/ewald_electrode.cpp @@ -892,16 +892,16 @@ void EwaldElectrode::compute_vector(double *vec, int sensor_grpbit, int source_g { update_eikr(false); - int const nlocal = atom->nlocal; + const int nlocal = atom->nlocal; double *q = atom->q; int *mask = atom->mask; std::vector q_cos(kcount); std::vector q_sin(kcount); for (int k = 0; k < kcount; k++) { - int const kx = kxvecs[k]; - int const ky = kyvecs[k]; - int const kz = kzvecs[k]; + const int kx = kxvecs[k]; + const int ky = kyvecs[k]; + const int kz = kzvecs[k]; double q_cos_k = 0; double q_sin_k = 0; for (int i = 0; i < nlocal; i++) { @@ -926,9 +926,9 @@ void EwaldElectrode::compute_vector(double *vec, int sensor_grpbit, int source_g if (!(mask[i] & sensor_grpbit)) continue; double bi = 0; for (int k = 0; k < kcount; k++) { - int const kx = kxvecs[k]; - int const ky = kyvecs[k]; - int const kz = kzvecs[k]; + const int kx = kxvecs[k]; + const int ky = kyvecs[k]; + const int kz = kzvecs[k]; double const cos_kxky = cs[kx][0][i] * cs[ky][1][i] - sn[kx][0][i] * sn[ky][1][i]; double const sin_kxky = sn[kx][0][i] * cs[ky][1][i] + cs[kx][0][i] * sn[ky][1][i]; double const cos_kr = cos_kxky * cs[kz][2][i] - sin_kxky * sn[kz][2][i]; @@ -1074,11 +1074,11 @@ void EwaldElectrode::compute_matrix(bigint *imat, double **matrix, bool /* timer // anyway, use local sn and cs for simplicity - int const kx = kxvecs[k]; - int const ky = kyvecs[k]; - int const kz = kzvecs[k]; - int const sign_ky = (ky > 0) - (ky < 0); - int const sign_kz = (kz > 0) - (kz < 0); + const int kx = kxvecs[k]; + const int ky = kyvecs[k]; + const int kz = kzvecs[k]; + const int sign_ky = (ky > 0) - (ky < 0); + const int sign_kz = (kz > 0) - (kz < 0); double cos_kxky = cs[kx][0][i] * cs[ky][1][i] - sn[kx][0][i] * sn[ky][1][i]; double sin_kxky = sn[kx][0][i] * cs[ky][1][i] + cs[kx][0][i] * sn[ky][1][i]; @@ -1088,9 +1088,9 @@ void EwaldElectrode::compute_matrix(bigint *imat, double **matrix, bool /* timer // global indexing csx_all[kx+j*(kxmax+1)] <> csx_all[kx][j] - int const kxj = kx + j * (kxmax + 1); - int const kyj = abs(ky) + j * (kymax + 1); - int const kzj = abs(kz) + j * (kzmax + 1); + const int kxj = kx + j * (kxmax + 1); + const int kyj = abs(ky) + j * (kymax + 1); + const int kzj = abs(kz) + j * (kzmax + 1); cos_kxky = csx_all[kxj] * csy_all[kyj] - snx_all[kxj] * sny_all[kyj] * sign_ky; sin_kxky = snx_all[kxj] * csy_all[kyj] + csx_all[kxj] * sny_all[kyj] * sign_ky; diff --git a/src/ELECTRODE/fix_electrode_conp.cpp b/src/ELECTRODE/fix_electrode_conp.cpp index a64eb5f71d..fd2aa9ba7a 100644 --- a/src/ELECTRODE/fix_electrode_conp.cpp +++ b/src/ELECTRODE/fix_electrode_conp.cpp @@ -337,7 +337,7 @@ int FixElectrodeConp::modify_param(int narg, char **arg) tfflag = true; // read atom type, Thomas-Fermi length, and voronoi volume (reciprocal // number density) - int const type = utils::inumeric(FLERR, arg[1], false, lmp); + const int type = utils::inumeric(FLERR, arg[1], false, lmp); double const len = utils::numeric(FLERR, arg[2], false, lmp); double const voronoi = utils::numeric(FLERR, arg[3], false, lmp); // check type exists and is completely in electrode @@ -417,7 +417,7 @@ void FixElectrodeConp::init() error->all(FLERR, "More than one fix electrode"); // make sure electrode atoms are not integrated if a matrix is used for electrode-electrode interaction - int const nlocal = atom->nlocal; + const int nlocal = atom->nlocal; int *mask = atom->mask; if (matrix_algo) { std::vector integrate_fixes; @@ -494,7 +494,7 @@ void FixElectrodeConp::post_constructor() void FixElectrodeConp::setup_post_neighbor() { - int const nlocal = atom->nlocal; + const int nlocal = atom->nlocal; int *mask = atom->mask; tagint *tag = atom->tag; @@ -546,7 +546,7 @@ void FixElectrodeConp::setup_post_neighbor() size_t n = order.size(); std::vector> ordered_mat(n, std::vector(n)); for (size_t i = 0; i < n; i++) { - bigint const gi = order[i]; + const bigint gi = order[i]; for (size_t j = 0; j < n; j++) { ordered_mat[gi][order[j]] = mat[i][j]; } } return ordered_mat; @@ -663,7 +663,7 @@ void FixElectrodeConp::invert() if (timer_flag && (comm->me == 0)) utils::logmesg(lmp, "CONP inverting matrix\n"); int m = ngroup, n = ngroup, lda = ngroup; std::vector ipiv(ngroup); - int const lwork = ngroup * ngroup; + const int lwork = ngroup * ngroup; std::vector work(lwork); int info_rf, info_ri; @@ -708,8 +708,8 @@ void FixElectrodeConp::setup_pre_exchange() // create_taglist if (!matrix_algo) return; int *mask = atom->mask; - int const nlocal = atom->nlocal; - int const nprocs = comm->nprocs; + const int nlocal = atom->nlocal; + const int nprocs = comm->nprocs; tagint *tag = atom->tag; delete[] recvcounts; @@ -733,7 +733,7 @@ void FixElectrodeConp::setup_pre_exchange() // create_taglist MPI_Allgather(&gnum_local, 1, MPI_INT, recvcounts, 1, MPI_INT, world); displs[0] = 0; for (int i = 1; i < nprocs; i++) { displs[i] = displs[i - 1] + recvcounts[i - 1]; } - int const gnum = displs[nprocs - 1] + recvcounts[nprocs - 1]; + const int gnum = displs[nprocs - 1] + recvcounts[nprocs - 1]; std::vector taglist_all(gnum); MPI_Allgatherv(taglist_local_group.data(), gnum_local, MPI_LMP_TAGINT, taglist_all.data(), recvcounts, displs, MPI_LMP_TAGINT, world); @@ -809,7 +809,7 @@ void FixElectrodeConp::compute_sd_vectors_ffield() double zprd = domain->prd[2]; for (int i = 0; i < atom->nlocal; i++) { if (mask[i] & groupbit) { - int const i_iele = tag_to_iele[tag[i]]; + const int i_iele = tag_to_iele[tag[i]]; double const zprd_offset = (mask[i] & group_bits[top_group]) ? 0.0 : 1.0; double const evscale_elez = evscale * (x[i][2] / zprd + zprd_offset); for (int g = 0; g < num_of_groups; g++) { @@ -874,7 +874,7 @@ void FixElectrodeConp::update_charges() double mult_start = MPI_Wtime(); for (int i_iele = 0; i_iele < nlocalele; i_iele++) { double q_tmp = 0; - int const iele = list_iele[i_iele]; + const int iele = list_iele[i_iele]; double *_noalias caprow = capacitance[iele]; for (int j = 0; j < ngroup; j++) { q_tmp -= caprow[j] * potential_iele[j]; } q_local[i_iele] = q_tmp; @@ -979,7 +979,7 @@ std::vector FixElectrodeConp::gather_ngroup(std::vector x_local) { auto x = std::vector(ngroup, 0.); for (int i = 0; i < nlocalele; i++) { - int const iele = list_iele[i]; + const int iele = list_iele[i]; x[iele] = x_local[i]; } MPI_Allreduce(MPI_IN_PLACE, x.data(), ngroup, MPI_DOUBLE, MPI_SUM, world); @@ -1124,7 +1124,7 @@ void FixElectrodeConp::compute_macro_matrices() int m = num_of_groups; int n = m, lda = m; std::vector ipiv(m); - int const lwork = m * m; + const int lwork = m * m; std::vector work(lwork); std::vector tmp(lwork); @@ -1186,7 +1186,7 @@ double FixElectrodeConp::potential_energy() { // corrections to energy due to potential psi double const qqrd2e = force->qqrd2e; - int const nlocal = atom->nlocal; + const int nlocal = atom->nlocal; int *mask = atom->mask; double *q = atom->q; double energy = 0; @@ -1205,7 +1205,7 @@ double FixElectrodeConp::self_energy(int eflag) { // corrections to energy due to self interaction double const qqrd2e = force->qqrd2e; - int const nlocal = atom->nlocal; + const int nlocal = atom->nlocal; double const pre = 1. / sqrt(MY_2PI) * qqrd2e; int *mask = atom->mask; int *type = atom->type; @@ -1235,7 +1235,7 @@ double FixElectrodeConp::gausscorr(int eflag, int vflag, bool fflag) // correction to short range interaction due to eta double const qqrd2e = force->qqrd2e; - int const nlocal = atom->nlocal; + const int nlocal = atom->nlocal; int *mask = atom->mask; double *q = atom->q; double **x = atom->x; @@ -1260,7 +1260,7 @@ double FixElectrodeConp::gausscorr(int eflag, int vflag, bool fflag) int jnum = numneigh[i]; for (int jj = 0; jj < jnum; jj++) { - int const j = jlist[jj] & NEIGHMASK; + const int j = jlist[jj] & NEIGHMASK; bool j_in_ele = groupbit & mask[j]; if (!(i_in_ele || j_in_ele)) continue; @@ -1411,7 +1411,7 @@ void FixElectrodeConp::read_from_file(const std::string &input_file, double **ar if ((bigint) idx.size() != ngroup) error->all(FLERR, "Read tags do not match taglist of fix {}", style); for (bigint i = 0; i < ngroup; i++) { - bigint const ii = idx[i]; + const bigint ii = idx[i]; for (bigint j = 0; j < ngroup; j++) array[i][j] = matrix[ii][idx[j]]; } } @@ -1422,7 +1422,7 @@ void FixElectrodeConp::read_from_file(const std::string &input_file, double **ar void FixElectrodeConp::request_etypes_neighlists() { - int const ntypes = atom->ntypes; + const int ntypes = atom->ntypes; // construct etypes int *mask = atom->mask; int *type = atom->type; @@ -1513,7 +1513,7 @@ void FixElectrodeConp::gather_list_iele() int *mask = atom->mask; tagint *tag = atom->tag; - int const nlocal = atom->nlocal; + const int nlocal = atom->nlocal; if (matrix_algo) { list_iele.clear(); list_iele.reserve(nlocalele); @@ -1522,7 +1522,7 @@ void FixElectrodeConp::gather_list_iele() iele_to_group_local.clear(); for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { - tagint const t = tag[i]; + const tagint t = tag[i]; if (matrix_algo) list_iele.push_back(tag_to_iele[t]); taglist_local.push_back(t); for (int g = 0; g < num_of_groups; g++) @@ -1535,7 +1535,7 @@ void FixElectrodeConp::gather_list_iele() if (matrix_algo) { MPI_Allgather(&nlocalele, 1, MPI_INT, recvcounts, 1, MPI_INT, world); displs[0] = 0; - int const nprocs = comm->nprocs; + const int nprocs = comm->nprocs; for (int i = 1; i < nprocs; i++) { displs[i] = displs[i - 1] + recvcounts[i - 1]; } MPI_Allgatherv(list_iele.data(), nlocalele, MPI_INT, iele_gathered, recvcounts, displs, MPI_INT, @@ -1565,8 +1565,8 @@ void FixElectrodeConp::buffer_and_gather(double *ivec, double *elevec) double FixElectrodeConp::memory_usage() { - int const nprocs = comm->nprocs; - int const nmax = atom->nmax; + const int nprocs = comm->nprocs; + const int nmax = atom->nmax; double bytes = 0.0; bytes += nmax * (sizeof(double)); // potential_i if (matrix_algo) { @@ -1611,7 +1611,7 @@ int FixElectrodeConp::pack_forward_comm(int n, int *list, double *buf, int /*pbc { int m = 0; for (int i = 0; i < n; i++) { - int const j = list[i]; + const int j = list[i]; buf[m++] = atom->q[j]; } return m; @@ -1621,7 +1621,7 @@ int FixElectrodeConp::pack_forward_comm(int n, int *list, double *buf, int /*pbc void FixElectrodeConp::unpack_forward_comm(int n, int first, double *buf) { - int const last = first + n; + const int last = first + n; for (int i = first, m = 0; i < last; i++) atom->q[i] = buf[m++]; } diff --git a/src/ELECTRODE/fix_electrode_conq.cpp b/src/ELECTRODE/fix_electrode_conq.cpp index 5e88ac502d..07c000c56d 100644 --- a/src/ELECTRODE/fix_electrode_conq.cpp +++ b/src/ELECTRODE/fix_electrode_conq.cpp @@ -49,7 +49,7 @@ FixElectrodeConq::FixElectrodeConq(LAMMPS *lmp, int narg, char **arg) : void FixElectrodeConq::update_psi() { - int const numsymm = num_of_groups - ((symm) ? 1 : 0); + const int numsymm = num_of_groups - ((symm) ? 1 : 0); bool symm_update_back = false; for (int g = 0; g < numsymm; g++) { if (group_psi_var_styles[g] == VarStyle::CONST) continue; @@ -82,7 +82,7 @@ void FixElectrodeConq::update_psi() std::vector FixElectrodeConq::constraint_correction(std::vector x) { - int const n = x.size(); + const int n = x.size(); auto sums = std::vector(num_of_groups, 0); for (int i = 0; i < n; i++) sums[iele_to_group_local[i]] += x[i]; MPI_Allreduce(MPI_IN_PLACE, sums.data(), num_of_groups, MPI_DOUBLE, MPI_SUM, world); @@ -100,7 +100,7 @@ std::vector FixElectrodeConq::constraint_correction(std::vector std::vector FixElectrodeConq::constraint_projection(std::vector x) { - int const n = x.size(); + const int n = x.size(); auto sums = std::vector(num_of_groups, 0); for (int i = 0; i < n; i++) sums[iele_to_group_local[i]] += x[i]; MPI_Allreduce(MPI_IN_PLACE, sums.data(), num_of_groups, MPI_DOUBLE, MPI_SUM, world); @@ -115,7 +115,7 @@ std::vector FixElectrodeConq::constraint_projection(std::vector void FixElectrodeConq::recompute_potential(std::vector b, std::vector q_local) { - int const n = b.size(); + const int n = b.size(); auto a = ele_ele_interaction(q_local); auto psi_sums = std::vector(num_of_groups, 0); for (int i = 0; i < n; i++) { psi_sums[iele_to_group_local[i]] += (a[i] + b[i]) / evscale; } diff --git a/src/ELECTRODE/fix_electrode_thermo.cpp b/src/ELECTRODE/fix_electrode_thermo.cpp index 89cf267ffb..c5c2e4a19b 100644 --- a/src/ELECTRODE/fix_electrode_thermo.cpp +++ b/src/ELECTRODE/fix_electrode_thermo.cpp @@ -76,7 +76,7 @@ void FixElectrodeThermo::compute_macro_matrices() void FixElectrodeThermo::pre_update() { // total electrode charges after last step, required for update psi - int const nlocal = atom->nlocal; + const int nlocal = atom->nlocal; int *mask = atom->mask; double *q = atom->q; for (int g = 0; g < NUM_GROUPS; g++) { diff --git a/src/ELECTRODE/pppm_electrode.cpp b/src/ELECTRODE/pppm_electrode.cpp index 6361ca9ccc..43108342d8 100644 --- a/src/ELECTRODE/pppm_electrode.cpp +++ b/src/ELECTRODE/pppm_electrode.cpp @@ -683,7 +683,7 @@ void PPPMElectrode::compute_matrix(bigint *imat, double **matrix, bool timer_fla n += 2; } MPI_Allreduce(MPI_IN_PLACE, greens_real, nz_pppm * ny_pppm * nx_pppm, MPI_DOUBLE, MPI_SUM, world); - int const nlocal = atom->nlocal; + const int nlocal = atom->nlocal; int nmat = std::count_if(&imat[0], &imat[nlocal], [](int x) { return x >= 0; }); @@ -712,13 +712,13 @@ void PPPMElectrode::compute_matrix(bigint *imat, double **matrix, bool timer_fla /* ----------------------------------------------------------------------*/ void PPPMElectrode::one_step_multiplication(bigint *imat, double *greens_real, double **x_ele, - double **matrix, int const nmat, bool timer_flag) + double **matrix, const int nmat, bool timer_flag) { // map green's function in real space from mesh to particle positions // with matrix multiplication 'W^T G W' in one steps. Uses less memory than // two_step_multiplication // - int const nlocal = atom->nlocal; + const int nlocal = atom->nlocal; double **x = atom->x; MPI_Barrier(world); double step1_time = MPI_Wtime(); @@ -730,7 +730,7 @@ void PPPMElectrode::one_step_multiplication(bigint *imat, double *greens_real, d if (jpos < 0) continue; j_list.push_back(j); } - int const nj_local = j_list.size(); + const int nj_local = j_list.size(); FFT_SCALAR ***rho1d_j; memory->create(rho1d_j, nj_local, 3, order, "pppm/electrode:rho1d_j"); @@ -753,8 +753,8 @@ void PPPMElectrode::one_step_multiplication(bigint *imat, double *greens_real, d // (nx,ny,nz) = global coords of grid pt to "lower left" of charge // (dx,dy,dz) = distance to "lower left" grid pt // (mx,my,mz) = global coords of moving stencil pt - int const order2 = order * order; - int const order6 = order2 * order2 * order2; + const int order2 = order * order; + const int order6 = order2 * order2 * order2; double *amesh; memory->create(amesh, order6, "pppm/electrode:amesh"); for (int ipos = 0; ipos < nmat; ipos++) { @@ -831,13 +831,13 @@ void PPPMElectrode::build_amesh(const int dx, // = njx - nix for (int iz = 0; iz < order; iz++) for (int jz = 0; jz < order; jz++) { - int const mz = fmod(dz + jz - iz, nz_pppm) * nx_pppm * ny_pppm; + const int mz = fmod(dz + jz - iz, nz_pppm) * nx_pppm * ny_pppm; for (int iy = 0; iy < order; iy++) for (int jy = 0; jy < order; jy++) { - int const my = fmod(dy + jy - iy, ny_pppm) * nx_pppm; + const int my = fmod(dy + jy - iy, ny_pppm) * nx_pppm; for (int ix = 0; ix < order; ix++) for (int jx = 0; jx < order; jx++) { - int const mx = fmod(dx + jx - ix, nx_pppm); + const int mx = fmod(dx + jx - ix, nx_pppm); amesh[ind_amesh] = greens_real[mz + my + mx]; ind_amesh++; } @@ -848,12 +848,12 @@ void PPPMElectrode::build_amesh(const int dx, // = njx - nix /* ----------------------------------------------------------------------*/ void PPPMElectrode::two_step_multiplication(bigint *imat, double *greens_real, double **x_ele, - double **matrix, int const nmat, bool timer_flag) + double **matrix, const int nmat, bool timer_flag) { // map green's function in real space from mesh to particle positions // with matrix multiplication 'W^T G W' in two steps. gw is result of // first multiplication. - int const nlocal = atom->nlocal; + const int nlocal = atom->nlocal; MPI_Barrier(world); double step1_time = MPI_Wtime(); int nx_ele = nxhi_out - nxlo_out + 1; // nx_pppm + order + 1; @@ -892,15 +892,15 @@ void PPPMElectrode::two_step_multiplication(bigint *imat, double *greens_real, d for (int mjz = nzlo_out; mjz <= nzhi_out; mjz++) { for (int ni = nlower; ni <= nupper; ni++) { double const iz0 = rho1d[2][ni]; - int const mz = fmod(mjz - ni - niz, nz_pppm); + const int mz = fmod(mjz - ni - niz, nz_pppm); for (int mjy = nylo_out; mjy <= nyhi_out; mjy++) { for (int mi = nlower; mi <= nupper; mi++) { double const iy0 = iz0 * rho1d[1][mi]; - int const my = fmod(mjy - mi - niy, ny_pppm); + const int my = fmod(mjy - mi - niy, ny_pppm); for (int mjx = nxlo_out; mjx <= nxhi_out; mjx++) { for (int li = nlower; li <= nupper; li++) { double const ix0 = iy0 * rho1d[0][li]; - int const mx = fmod(mjx - li - nix, nx_pppm); + const int mx = fmod(mjx - li - nix, nx_pppm); gw[ipos][nx_ele * ny_ele * (mjz - nzlo_out) + nx_ele * (mjy - nylo_out) + (mjx - nxlo_out)] += ix0 * greens_real[mz * nx_pppm * ny_pppm + my * nx_pppm + mx]; diff --git a/src/ELECTRODE/pppm_electrode.h b/src/ELECTRODE/pppm_electrode.h index 84a9465204..42606efcd2 100644 --- a/src/ELECTRODE/pppm_electrode.h +++ b/src/ELECTRODE/pppm_electrode.h @@ -93,8 +93,8 @@ class PPPMElectrode : public PPPM, public ElectrodeKSpace { void start_compute(); void make_rho_in_brick(int, FFT_SCALAR ***, bool); void project_psi(double *, int); - void one_step_multiplication(bigint *, double *, double **, double **, int const, bool); - void two_step_multiplication(bigint *, double *, double **, double **, int const, bool); + void one_step_multiplication(bigint *, double *, double **, double **, const int, bool); + void two_step_multiplication(bigint *, double *, double **, double **, const int, bool); void build_amesh(int, int, int, double *, double *); bool compute_vector_called; }; diff --git a/src/ELECTRODE/slab_2d.cpp b/src/ELECTRODE/slab_2d.cpp index 942e73a303..a8e4732707 100644 --- a/src/ELECTRODE/slab_2d.cpp +++ b/src/ELECTRODE/slab_2d.cpp @@ -86,7 +86,7 @@ void Slab2d::compute_corr(double /*qsum*/, int eflag_atom, int eflag_global, dou void Slab2d::vector_corr(double *vec, int sensor_grpbit, int source_grpbit, bool invert_source) { - int const nlocal = atom->nlocal; + const int nlocal = atom->nlocal; double **x = atom->x; double *q = atom->q; int *mask = atom->mask; diff --git a/src/ELECTRODE/slab_dipole.cpp b/src/ELECTRODE/slab_dipole.cpp index de250715fd..5a2b62297b 100644 --- a/src/ELECTRODE/slab_dipole.cpp +++ b/src/ELECTRODE/slab_dipole.cpp @@ -93,7 +93,7 @@ void SlabDipole::compute_corr(double qsum, int eflag_atom, int eflag_global, dou void SlabDipole::vector_corr(double *vec, int sensor_grpbit, int source_grpbit, bool invert_source) { double const volume = get_volume(); - int const nlocal = atom->nlocal; + const int nlocal = atom->nlocal; double **x = atom->x; double *q = atom->q; int *mask = atom->mask; diff --git a/src/ELECTRODE/wire_dipole.cpp b/src/ELECTRODE/wire_dipole.cpp index b5fa0b97fb..d3d3845720 100644 --- a/src/ELECTRODE/wire_dipole.cpp +++ b/src/ELECTRODE/wire_dipole.cpp @@ -97,7 +97,7 @@ void WireDipole::compute_corr(double /*qsum*/, int eflag_atom, int eflag_global, void WireDipole::vector_corr(double *vec, int sensor_grpbit, int source_grpbit, bool invert_source) { double const volume = get_volume(); - int const nlocal = atom->nlocal; + const int nlocal = atom->nlocal; double **x = atom->x; double *q = atom->q; int *mask = atom->mask;